CN107807884B - Method for modular management of error codes - Google Patents

Method for modular management of error codes Download PDF

Info

Publication number
CN107807884B
CN107807884B CN201711083448.4A CN201711083448A CN107807884B CN 107807884 B CN107807884 B CN 107807884B CN 201711083448 A CN201711083448 A CN 201711083448A CN 107807884 B CN107807884 B CN 107807884B
Authority
CN
China
Prior art keywords
error code
error
module
function
sub
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
CN201711083448.4A
Other languages
Chinese (zh)
Other versions
CN107807884A (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.)
G Cloud Technology Co Ltd
Original Assignee
G Cloud Technology 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 G Cloud Technology Co Ltd filed Critical G Cloud Technology Co Ltd
Priority to CN201711083448.4A priority Critical patent/CN107807884B/en
Publication of CN107807884A publication Critical patent/CN107807884A/en
Application granted granted Critical
Publication of CN107807884B publication Critical patent/CN107807884B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the technical field of software development, in particular to a method for modularly managing error codes. Defining an error code storage container, an error code registration function and an error code reading function in a parent module; the error code registration function and the error code reading function have the capability of automatically identifying the module to which the error code belongs; then, defining an error code register in each submodule and automatically calling an error code register function; when the business layer of the sub-module needs to throw the exception, the sub-module calls an error code reading function to obtain the needed error code for exception throwing. The invention automatically divides the error codes into each sub-module for management, solves the problem that the error codes are difficult to maintain, and can be applied to a modularized multi-person collaborative development system.

Description

Method for modular management of error codes
Technical Field
The invention relates to the technical field of software development, in particular to a method for modularly managing error codes.
Technical Field
In the abnormal architecture of system software, error codes distinguish modules, services, functions and numbers by means of naming specifications. But often inadvertently fails to comply with the specification, resulting in the naming of the error code becoming random. In multi-person collaborative development, the concentration of error codes causes the following problems:
1. multiple persons develop cooperatively, so that modification conflict is easy to occur;
2. modification of one module can affect all modules, when the error code of one module does not conform to the naming specification, unexpected errors occur in all modules, and care is needed when the error code is newly added, so that inconvenience is caused;
3. the error codes are stored in a centralized manner, so that whether one error code is quoted by other modules cannot be judged, and the error codes are difficult to modify and delete.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method for modularly managing error codes, and a series of problems caused by centralized storage of the error codes are solved.
The technical scheme for solving the technical problems is as follows:
the method comprises the steps of defining an error code storage container, an error code registration function and an error code reading function in a parent module; the error code registration function and the error code reading function have the capability of automatically identifying the module to which the error code belongs; then, defining an error code register in each submodule and automatically calling an error code register function; when the business layer of the sub-module needs to throw the exception, the sub-module calls an error code reading function to obtain the needed error code for exception throwing.
The error code storage container is a hash table, and the fields of the error code storage container comprise a module to which the error code belongs, a service to which the error code belongs, a function to which the error code belongs, an error code number and an error code content text.
The parameters of the error code registration function comprise the service of the error code, the function of the error code, the serial number of the error code and the text of the content of the error code, the error code registration function obtains the module of the error code by capturing the information in the current thread, and the information is stored in an error code storage container.
The parameters of the error code reading function comprise the service of the error code, the function of the error code and the error code number, the error code reading function obtains the module of the error code by capturing the information in the current thread, and the corresponding error code is taken out from the error code storage container by utilizing the information.
And the error code register records all error codes of the current sub-modules, and when the system is started, the error code register of all the sub-modules automatically calls an error code registration function and automatically stores the error codes into the error code storage container in a module division mode.
The invention encapsulates the operation of the error code in the father module, all the sub-modules call the same code to achieve the unified management, although the same code is used, because the father module can automatically identify the sub-modules, each sub-module can only operate the error code of the module, thereby achieving the isolation between the modules. The invention automatically divides the error codes into each sub-module for management, solves the problem that the error codes are difficult to maintain, and can be applied to a modularized multi-person collaborative development system.
Drawings
The invention is further described below with reference to the accompanying drawings:
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
As shown in fig. 1, the basic process of the present invention is as follows:
1. establishing an error code data model, wherein the code is as follows:
Figure BDA0001459522610000031
2. establishing an error code storage container, an error code registration function and an error code reading function in a parent module, wherein the codes are as follows:
Figure BDA0001459522610000032
Figure BDA0001459522610000041
Figure BDA0001459522610000051
3. defining an error code register in the sub-module, the code is as follows:
Figure BDA0001459522610000052
4. an exception is thrown at the submodule with the error code read function, the code being as follows:
Figure BDA0001459522610000053
Figure BDA0001459522610000061

Claims (1)

1. a method for modular management of error codes, comprising: the method comprises a parent module and a child module;
(1) defining an error code storage container, an error code registration function and an error code reading function in a parent module;
the error code storage container is a hash table, and the fields of the error code storage container comprise an error code affiliated module, an error code affiliated service, an error code affiliated function, an error code number and an error code content text;
the parameters of the error code registration function comprise the business of the error code, the function of the error code, the serial number of the error code and the text of the content of the error code; the error code registration function acquires the module information of the error code by capturing the information in the current thread and stores the information into an error code storage container;
the parameters of the error code reading function comprise the business to which the error code belongs, the function to which the error code belongs and the error code number, the error code reading function obtains the module information to which the error code belongs by capturing the information in the current thread, and the corresponding error code is taken out from the error code storage container by utilizing the information;
the error code registration function and the error code reading function have the capability of automatically identifying the sub-modules to which the error codes belong;
(2) defining an error code register in each submodule and automatically calling an error code register function;
the error code register records all error codes of the current sub-modules, and when the system is started, the error code register of all the sub-modules automatically calls an error code registration function and automatically divides the error codes into modules to be stored in an error code storage container;
(3) the operation of the error code is packaged in a parent module, all the sub-modules call the same code to carry out unified management, although the same code is used, because the parent module can automatically identify the sub-modules, each sub-module can only operate the error code of the module of the sub-module;
(4) and automatically dividing the error codes into each submodule for management, and calling an error code reading function by the submodule when the service layer of the submodule needs to throw the exception to obtain the needed error codes for exception throwing.
CN201711083448.4A 2017-11-07 2017-11-07 Method for modular management of error codes Active CN107807884B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711083448.4A CN107807884B (en) 2017-11-07 2017-11-07 Method for modular management of error codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711083448.4A CN107807884B (en) 2017-11-07 2017-11-07 Method for modular management of error codes

Publications (2)

Publication Number Publication Date
CN107807884A CN107807884A (en) 2018-03-16
CN107807884B true CN107807884B (en) 2021-11-19

Family

ID=61583589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711083448.4A Active CN107807884B (en) 2017-11-07 2017-11-07 Method for modular management of error codes

Country Status (1)

Country Link
CN (1) CN107807884B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109445770B (en) * 2018-10-16 2022-06-17 武汉斗鱼网络科技有限公司 Error code processing method, device, medium and equipment
CN113328895B (en) * 2021-06-21 2023-08-29 河北幸福消费金融股份有限公司 Error code management system, abnormality positioning method, and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199819A (en) * 2014-07-03 2014-12-10 北京思特奇信息技术股份有限公司 WEB system error processing method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100543683C (en) * 2006-12-26 2009-09-23 华为技术有限公司 The method and system that process is monitored
CN102479138A (en) * 2010-11-29 2012-05-30 鸿富锦精密工业(深圳)有限公司 System and method for detecting error by utilizing image
CN104331367A (en) * 2014-11-12 2015-02-04 浪潮(北京)电子信息产业有限公司 Method and system for exception handling in Java engineering project development
CN107145422B (en) * 2017-03-14 2020-08-28 卡斯柯信号有限公司 Software fault alarm monitoring method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199819A (en) * 2014-07-03 2014-12-10 北京思特奇信息技术股份有限公司 WEB system error processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Error correction technique based on modular correcting codes";Vasyl Yatskiv 等;《2016 IEEE 36th International Conference on Electronics and Nanotechnology (ELNANO)》;20160616;第362-364页 *

Also Published As

Publication number Publication date
CN107807884A (en) 2018-03-16

Similar Documents

Publication Publication Date Title
CN107147704B (en) block chain-oriented universal service middleware system
CN108512689A (en) Micro services business monitoring method and server
CN103870274A (en) Visual development assembly for realizing data interaction between heterogeneous systems based on web service technology
CN107807884B (en) Method for modular management of error codes
CN102480374B (en) Method and equipment for alarming information processing report
CN101655795B (en) Method for creating service embodiment and system thereof
CN103957188A (en) Symmetrical bidirectional decoupling enterprise service description method and service scheduling system
CN103631600A (en) Data processing method and system for embedded RFID (radio frequency identification) middleware
CN104765596A (en) Request handling method and device
CN106372160A (en) Distributive database and management method
CN109858257B (en) Access control method and device
CN112835713B (en) Workload combination unified deployment method and system based on multi-container cluster
CN102999329B (en) The Active Directory interface exploitation method of configuration is mapped based on extend markup language
CN107291938B (en) Order inquiry system and method
CN104239780A (en) User terminal, security set selection method, and user terminal program
CN108446141B (en) Web front-end plug-in and method for scheduling and communicating based on same
CN109783132B (en) Method and device for realizing system singleization and distribution
CN110008068B (en) Distributed task disaster recovery method and device thereof
CN101082969A (en) Method and system for categorized displaying multiple sets kalendar affair in unified kalendar views
CN103020071A (en) Data synchronization method and data synchronization device
CN116136801B (en) Cloud platform data processing method and device, electronic equipment and storage medium
CN110471896A (en) A kind of data processing method, system and server
CN102184105A (en) Data processing method based on modularity and data center system
CN111930441B (en) Consul-based configuration file management system and method
CN102281584A (en) Method and system for implementing capability of Internet of things

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 19 / F, Cloud Computing Center, Chinese Academy of Sciences, No.1 Kehui Road, Songshanhu high tech Industrial Development Zone, Dongguan City, Guangdong Province, 523000

Applicant after: G-CLOUD TECHNOLOGY Co.,Ltd.

Address before: 523808 No. 14 Building, Songke Garden, Songshan Lake Science and Technology Industrial Park, Dongguan City, Guangdong Province

Applicant before: G-CLOUD TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant