CN113704021A - Error code generation method, device, equipment and medium based on abnormal information - Google Patents

Error code generation method, device, equipment and medium based on abnormal information Download PDF

Info

Publication number
CN113704021A
CN113704021A CN202111019395.6A CN202111019395A CN113704021A CN 113704021 A CN113704021 A CN 113704021A CN 202111019395 A CN202111019395 A CN 202111019395A CN 113704021 A CN113704021 A CN 113704021A
Authority
CN
China
Prior art keywords
error
field
service
category
error code
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.)
Pending
Application number
CN202111019395.6A
Other languages
Chinese (zh)
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202111019395.6A priority Critical patent/CN113704021A/en
Publication of CN113704021A publication Critical patent/CN113704021A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/085Error detection or correction by redundancy in data representation, e.g. by using checking codes using codes with inherent redundancy, e.g. n-out-of-m codes

Landscapes

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

Abstract

The embodiment of the application discloses an error code generation method, an error code generation device, error code generation equipment and an error code generation medium based on abnormal information, wherein the method comprises the following steps: firstly, obtaining abnormal information of a target system, wherein the information comprises a first service identifier, a first error level and a first error type of a first error of the target system, then respectively generating a first field, a second field, a third field and a fourth field according to the first service identifier, the first error level and the first error type, and finally obtaining a first error code according to the first field, the second field, the third field and the fourth field. By adopting the method and the device, the specific error code can reflect which service of which service has errors of which type and the error level (namely the severity) of the errors by standardizing the error code to be a structure of service + error level + error type.

Description

Error code generation method, device, equipment and medium based on abnormal information
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method, an apparatus, a device, and a medium for generating an error code based on abnormal information.
Background
Error codes are used as a mark on a program after a certain error processing fails, and can be used for identifying and tracking abnormal conditions occurring in the system, in different business systems, each error code marks an abnormality and can be associated with a specific error reason of the program according to the error code.
Currently, in different existing service systems, because development teams are different, a unique error code is provided according to a certain service interface provided by an existing team service, and a specific abnormal condition corresponding to the unique error code is provided when a call is abnormal, for example, the parameter transmission lacks necessary parameters, the parameter format is incorrect, a micro-service is down abnormally, and the like, so that a corresponding error code is provided. Such false code prompts have obvious disadvantages: under the condition of a public interface, a service calling party cannot be intuitively known to which specific service line belongs according to the error code, and meanwhile, the error alarm level and criticality cannot be known through the error code in the same service interface.
Disclosure of Invention
The embodiment of the application provides an error code generation method, an error code generation device, error code generation equipment and error codes generation media based on abnormal information, so that a structure that a standardized error code is service + error level + error type is expected to be used, and a specific error code can reflect which type of error occurs in which service of which service line and the error level (namely, the severity) of the error.
In a first aspect, an embodiment of the present application provides an error code generation method based on exception information, where the method includes:
acquiring abnormal information of a target system, wherein the abnormal information comprises a first service identifier, a first error level and a first error category of a first error of the target system;
generating a first field according to the first service identifier;
generating a second field according to the first service identifier;
generating a third field according to the first error level;
generating a fourth field according to the first error category;
and obtaining a first error code according to the first field, the second field, the third field and the fourth field.
In one possible example, the first field is two bits in length; the length of the second field is two bits; the third field is one bit in length; the fourth field is three bits in length.
In one possible example, the first field consists of two digits; where the numbers 00-99 are used to represent 100 services.
In one possible example, the second field consists of two digits; where the numbers 00-99 are used to represent 100 services.
In one possible example, the third field consists of a one-digit number; where the numbers 0-9 are used to indicate 10 error levels.
In one possible example, the fourth field consists of a three-digit number; where the numbers 000- > 999 are used to represent 1000 error categories.
In one possible example, the method further comprises: under the condition that a second error occurs in the target system, acquiring scene information of the second error; determining a second error category of the second error corresponding to the scene information according to the scene information and a first mapping relation, wherein the first mapping relation comprises a corresponding relation between the scene information and the error category; acquiring a second error code of the second error according to the second error category; determining a second error level for the second error based on the second error code; determining a log category of the second error corresponding to the second error level according to the second error level and a second mapping relation, wherein the second mapping relation comprises a corresponding relation between the error level and the log category; and generating a service log of the second error according to the log category of the second error, and outputting the service log.
In one possible example, after obtaining a first error code according to the first field, the second field, the third field, and the fourth field, the method further includes: obtaining first prompt information according to the first error code, wherein the first prompt information is used for indicating the first error code and the first error; and outputting the first prompt message.
In one possible example, the outputting the first prompt information includes: broadcasting the first prompt message through a buzzer; and/or displaying the first prompt message through a display device.
In a second aspect, an embodiment of the present application provides an error code generation apparatus based on exception information, where the apparatus includes:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring abnormal information of a target system, and the abnormal information comprises a first service identifier, a first error level and a first error category of a first error of the target system;
a first field generating unit, configured to generate a first field according to the first service identifier;
a second field generating unit, configured to generate a second field according to the first service identifier;
a third field generating unit, configured to generate a third field according to the first error level;
a fourth field generating unit, configured to generate a fourth field according to the first error category;
an error code generating unit, configured to obtain a first error code according to the first field, the second field, the third field, and the fourth field.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the one or more programs including instructions for performing the steps of the method as set forth in the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the steps in the method as shown in the first aspect.
It can be seen that, in the embodiment of the present application, first, exception information of a target system is obtained, where the exception information includes a first service identifier, a first error level, and a first error type of a first error of the target system, then, a first field, a second field, a third field, and a fourth field are generated according to the first service identifier, the first error level, and the first error type, respectively, and finally, a first error code is obtained according to the first field, the second field, the third field, and the fourth field. It can be seen that, with the application, by standardizing the error code into a structure of service + error level + error category, it can be understood that the error code based on the structure can determine the first field, the second field, the third field, and the fourth field, and since the four fields are generated by the service identifier, the error level, and the error category, respectively, when the four fields are obtained, the corresponding service identifier, the error level, and the error category can be determined, the service identifier indicates a specific service line, and the service identifier indicates a specific service, so that it can be known that the specific error code can represent which service of which service line has an error of which category and the error level (i.e., the severity) of the error.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an error code generation method based on abnormal information according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an error code generation apparatus based on abnormal information according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, apparatus, and storage medium, product, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, product, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Currently, in different existing service systems, because development teams are different, a unique error code is provided according to a certain service interface provided by an existing team service, and a specific abnormal condition corresponding to the unique error code is provided when a call is abnormal, for example, the parameter transmission lacks necessary parameters, the parameter format is incorrect, a micro-service is down abnormally, and the like, so that a corresponding error code is provided. Such false code prompts have obvious disadvantages: under the condition of a public interface, a service calling party cannot be intuitively known to which specific service line belongs according to the error code, and meanwhile, the error alarm level and criticality cannot be known through the error code in the same service interface.
Based on the above problem, an embodiment of the present invention provides an error code generating method based on abnormal information, which is described in detail below.
Referring to fig. 1, fig. 1 is a schematic flow chart of an error code generation method based on abnormal information according to an embodiment of the present application, and as shown in fig. 1, the error code generation method based on abnormal information specifically includes the following steps S101 to S106.
S101, obtaining abnormal information of a target system, wherein the abnormal information comprises a first wrong service identifier, a wrong level and a wrong category of the target system.
The target system may be any service system, the service identifier may include, but is not limited to, a system identifier of the target system, and the system identifier may be any one of a system global, a system short, a system code, a system number, and the like. It should be noted that one service system corresponds to one system identifier, and different service systems correspond to different system identifiers. It can be understood that the service system corresponds to the service, and the service system with the error is known, that is, the service with the error is known. For example, the service system includes an account service system, a transaction service system, an information query service system, and the like, and is not particularly limited, and it is understood that a service corresponding to the account service system is an account service, a service corresponding to the transaction service system is a transaction service, and a service corresponding to information of the information query service system is a query service.
The service identifier may be any one of a full service name, a short service name, a service code, a service number, and the like of the service provided by the target system and generating the first error. It should be noted that one service corresponds to one service identifier, and different services correspond to different service identifiers. For example, the service may be an account login service, an account logout service, an account recovery service, and the like, which are not particularly limited.
Wherein the error level is used to reflect the severity of the error. The higher the error level, the more serious the error. The error category may indicate a specific error cause.
And S102, generating a first field according to the service identifier.
S103, generating a second field according to the service identifier.
And S104, generating a third field according to the error level.
And S105, generating a fourth field according to the error category.
S106, obtaining a first error code according to the first field, the second field, the third field and the fourth field.
The total length of the error code, the number of bits of the first field and the start position of the first field, the number of bits of the second field and the start position of the second field, the number of bits of the third field and the start position of the third field and the number of bits of the fourth field and the start position of the fourth field may be preset. The number of bits of the total length of the error code, the number of bits of the first field, the number of bits of the second field, the number of bits of the third field, the start position of the second field, the number of bits of the fourth field, and the order of arrangement among the first field, the second field, the third field, and the fourth field in the error code may also be set in advance. Based on the setting, the first field, the second field, the third field and the fourth field are combined to obtain the first error code.
In addition, the corresponding relationship between the service identifier and the first field, the corresponding relationship between the service identifier and the second field, the corresponding relationship between the error level and the third field, and the corresponding relationship between the error category and the fourth field need to be preset, so that after the abnormal information is acquired, the corresponding fields are generated.
It should be noted that the number of bits of the first field, the number of bits of the second field, the number of bits of the third field, the number of bits of the fourth field, the starting position of the first field, the starting position of the second field, the starting position of the third field, the starting position of the fourth field, the number of bits of the total length of the error codes, and the aforementioned arrangement sequence are not particularly limited. The user can make settings as desired.
Optionally, the length of the first field of the first error code is two bits; the length of a second field of the first error code is two bits; a third field of the first error code is one bit in length; a fourth field of the first error code is three bits in length.
It is understood that, in this case, the total length of the error code may be n bits, where n is greater than 8, where the number of bits is the number of bits in decimal number length, and the upper bits of the n bits of the error code except the lower 8 bits (i.e. the last 8 bits) are reserved bits for subsequent expansion, that is, the lower 8 bits of the n bits of the error code are specific bits of the error code representation.
Optionally, the first field consists of two digits; where the numbers 00-99 are used to represent 100 services.
Optionally, the second field consists of two digits; where the numbers 00-99 are used to represent 100 services.
Optionally, the third field consists of a single digit; where the numbers 0-9 are used to indicate 10 error levels.
Optionally, the fourth field consists of three digits; where the numbers 000- > 999 are used to represent 1000 error categories.
Illustratively, the [1,2] bits of the error code represent specific services, and the total number of the specific services is 100 from 00 to 99, and the specific services can correspond to 100 services at most, namely 100 service identifiers at most; the [3,4] bit of the error code represents the service corresponding to the service, and the total number of the error code is 100 from 00 to 99, and the error code can correspond to at most 100 services under specific services, namely at most 100 service identifiers; [5] the bits represent the error level, and the total number of the bits is 10 from 0 to 9, and the error level can be represented by 10 at most; the [6, 7, 8] bit represents a specific error category, and the total number of 1000 values from 000-999 can correspond to 1000 error categories at most (which can correspond to 1000 different error reasons at most).
Illustratively, for an account service 00, a login service under the account service 01, a more serious error 6, and a database reading failure 001, 00016001 indicates that the login service of the account service has encountered an error reading the database, and the error is ranked at 6.
Therefore, the scheme realizes the structure that the standardized error code is service + error level + error category from the actual requirement, it will be appreciated that the error code based on this structure can first determine the first field, the second field, the third field and the fourth field, since the four fields are generated by the service identification, the error level and the error category, respectively, therefore, under the condition of obtaining the four fields, corresponding service identification, error level and error category can be determined, the service identification indicates a specific service line, the service identification indicates a specific service, it can be seen that the specific error code may represent the service in which the error occurred, and the importance and error type of the error, in other words, the specific error code may represent which service of which service has occurred which type of error and the error level (i.e., severity) of the error.
In one possible example, the third field consists of a one-digit number; wherein, the numbers 0-9, the order of the numbers from small to large is used for representing the order of the error levels from low to high, or the order of the numbers from large to small is used for representing the order of the error levels from low to high.
In a specific implementation, when values of third fields of the error code a and the error code B are 4 and 9, respectively, if a sequence of field values from small to large indicates a sequence of error levels from low to high, an error level indicated by the error code a is smaller than an error level indicated by the error code B, and if a sequence of field values from large to small is used to indicate a sequence of error levels from low to high, an error level indicated by the error code B is smaller than an error level indicated by the error code a. In the process of practical application, the errors with high error levels can be processed preferentially.
It can be seen that, in this example, the errors can be divided into 10 error levels at most, and the error code can represent the error level of the error through the third field.
In one possible example, the method further comprises: under the condition that a second error occurs in the target system, acquiring scene information of the second error; determining a second error category of the second error corresponding to the scene information according to the scene information and a first mapping relation, wherein the first mapping relation comprises a corresponding relation between the scene information and the error category; acquiring a second error code of the second error according to the second error category; determining a second error level for the second error based on the second error code; determining a log category of the second error corresponding to the second error level according to the second error level and a second mapping relation, wherein the second mapping relation comprises a corresponding relation between the error level and the log category; and generating a service log of the second error according to the log category of the second error, and outputting the service log.
Wherein the scene information is used for indicating the scene where the error is located. The corresponding relation between all the scene information and the error categories which can occur is preset. And if the scene information is that the database is overtime, the error type corresponding to the scene information is that the database is failed to read.
The error level, the log category, and the correspondence between the error level and the log category are set in advance.
For example, the log categories may include regular logs, alarm logs, error logs. The conventional log is a conventional log printout, the alarm log indicates that some logic which does not conform to overstep expectations exists in the service and needs alarm attention, the error log indicates that the corresponding system processing meets errors and needs key attention, the third field corresponding to the error level is composed of a number of one bit, wherein 0-9, the sequence of the numbers from small to large is used for indicating the sequence of the error levels from low to high, the error levels can be preset to 10 levels, and the error levels from low to high are respectively 0, 1,2, 3,4, 5, 6, 7, 8 and 9. By defining the mapping of the error level in the error code to the log category, when the error level is 0, 1 and 2, the log corresponds to a conventional log, when the error level is 3,4 and 5, the log corresponds to an alarm log, and when the error level is 6, 7, 8 and 9, the log corresponds to an error log. And presenting the errors with different error levels through different types of logs so as to prompt related personnel as to the severity of the errors.
As a possible implementation manner, the implementation manner of obtaining the second error code of the second error according to the second error category may be: obtaining a third field of the second error according to the second error category; and querying an error code library by taking the third field as a query identifier to obtain a second error code of the second error of the third field comprising the second error. The error code library refers to a database for storing error codes.
As can be seen, in this example, the error level of the error can be obtained based on the detected scene information of the error and the obtained error code, so as to determine the corresponding log category based on the error level, and finally, generate the service log of the log category, so as to achieve the purpose of prompting the relevant person.
In one possible example, after obtaining a first error code according to the first field, the second field, the third field, and the fourth field, the method further includes: obtaining first prompt information according to the first error code, wherein the first prompt information is used for indicating the first error code and the first error; and outputting the first prompt message.
The first prompt message may be that the service of the service has generated an error of the type, and the error level of the error is.
And configuring prompt information for each error code in advance to feed back to a user, specifically, providing an error code configuration page, enabling the user to perform online configuration of the error codes and configuration information including the prompt information thereof when entering the page, and then storing the configuration information in a server.
The configuration information may be presented in a binary serialized format, and further, the configuration information may be encrypted and then stored.
As can be seen, in this example, corresponding prompt information can be generated based on the error code to prompt the relevant person.
In one possible example, the outputting the first prompt information includes: broadcasting the first prompt message through a buzzer; and/or displaying the first prompt message through a display device.
The number of times, the frequency of the first prompt message broadcast by the buzzer and the number of times of single broadcast are not particularly limited. The number of times, frequency and duration of each display of the first prompt message by the display device are not particularly limited.
In the concrete implementation, can report 5 times through bee calling organ first prompt information, and interval 5 minutes between reporting every two times, repeated report 3 times at every turn. Meanwhile, the first prompt message can be displayed for 1 time through the display device and continuously displayed for 5 minutes.
It can be seen that, in this example, the first prompt message can be presented through the buzzer and/or the display device, so as to prompt the relevant user to timely resolve the corresponding error.
In the case of an integrated unit, referring to fig. 2, fig. 2 provides a block diagram of functional units of an error code generation apparatus based on exception information. The error code generation device 200 based on the abnormal information includes:
an obtaining unit 210, configured to obtain exception information of a target system, where the exception information includes a first service identifier, a first error level, and a first error category of a first error of the target system;
a first field generating unit 220, configured to generate a first field according to the first service identifier;
a second field generating unit 230, configured to generate a second field according to the first service identifier;
a third field generating unit 240, configured to generate a third field according to the first error level;
a fourth field generating unit 250, configured to generate a fourth field according to the first error category;
an error code generating unit 260, configured to obtain a first error code according to the first field, the second field, the third field, and the fourth field.
The error code generating apparatus 200 based on the abnormal information may further include a storage unit 270 for storing program codes and data of the terminal. The storage unit 270 may be a memory. When the storage unit 270 is a memory, the error code generation apparatus 200 based on abnormal information according to the embodiment of the present application may be an electronic device shown in fig. 3.
It should be noted that specific implementation of each operation may be described in detail in the method embodiment shown in fig. 1, and is not described in detail here.
It can be seen that, in the embodiment of the present application, first, exception information of a target system is obtained, where the exception information includes a first service identifier, a first error level, and a first error type of a first error of the target system, then, a first field, a second field, a third field, and a fourth field are generated according to the first service identifier, the first error level, and the first error type, respectively, and finally, a first error code is obtained according to the first field, the second field, the third field, and the fourth field. It can be seen that, with the application, by standardizing the error code into a structure of service + error level + error category, it can be understood that the error code based on the structure can determine the first field, the second field, the third field, and the fourth field, and since the four fields are generated by the service identifier, the error level, and the error category, respectively, when the four fields are obtained, the corresponding service identifier, the error level, and the error category can be determined, the service identifier indicates a specific service line, and the service identifier indicates a specific service, so that it can be known that the specific error code can represent which service of which service line has an error of which category and the error level (i.e., the severity) of the error.
In one possible example, the first field is two bits in length; the length of the second field is two bits; the third field is one bit in length; the fourth field is three bits in length.
In one possible example, the first field consists of two digits; where the numbers 00-99 are used to represent 100 services.
In one possible example, the second field consists of two digits; where the numbers 00-99 are used to represent 100 services.
In one possible example, the third field consists of a one-digit number; where the numbers 0-9 are used to indicate 10 error levels.
In one possible example, the fourth field consists of a three-digit number; where the numbers 000- > 999 are used to represent 1000 error categories.
In one possible example, the apparatus further comprises a traffic log output unit configured to: under the condition that a second error occurs in the target system, acquiring scene information of the second error; determining a second error category of the second error corresponding to the scene information according to the scene information and a first mapping relation, wherein the first mapping relation comprises a corresponding relation between the scene information and the error category; acquiring a second error code of the second error according to the second error category; determining a second error level for the second error based on the second error code; determining a log category of the second error corresponding to the second error level according to the second error level and a second mapping relation, wherein the second mapping relation comprises a corresponding relation between the error level and the log category; and generating a service log of the second error according to the log category of the second error, and outputting the service log.
In one possible example, the apparatus further includes a prompt information output unit to: after obtaining a first error code according to the first field, the second field, the third field, and the fourth field, obtaining first prompt information according to the first error code, where the first prompt information is used to indicate the first error code and the first error; and outputting the first prompt message.
In one possible example, in the aspect of outputting the first prompt information, the prompt information output unit is specifically configured to: broadcasting the first prompt message through a buzzer; and/or displaying the first prompt message through a display device.
Referring to fig. 3, which is a schematic structural diagram of an electronic device provided in an embodiment of the present application, an electronic device 300 in the embodiment shown in fig. 3 may include: a processing module 310, a memory 320, a communication interface 330, and one or more programs 321, the one or more programs 321 being stored in the memory 320 and configured to be executed by the processing module 310, the one or more programs 321 comprising instructions for performing steps in a method as described below:
acquiring abnormal information of a target system, wherein the abnormal information comprises a first service identifier, a first error level and a first error category of a first error of the target system;
generating a first field according to the first service identifier;
generating a second field according to the first service identifier;
generating a third field according to the first error level;
generating a fourth field according to the first error category;
and obtaining a first error code according to the first field, the second field, the third field and the fourth field.
The Processing module 310 may be a Central Processing Unit (CPU), and the Processor may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should be noted that specific implementation of each operation may be described in detail in the method embodiment shown in fig. 1, and is not described in detail here.
It can be seen that, in the embodiment of the present application, first, exception information of a target system is obtained, where the exception information includes a first service identifier, a first error level, and a first error type of a first error of the target system, then, a first field, a second field, a third field, and a fourth field are generated according to the first service identifier, the first error level, and the first error type, respectively, and finally, a first error code is obtained according to the first field, the second field, the third field, and the fourth field. It can be seen that, with the application, by standardizing the error code into a structure of service + error level + error category, it can be understood that the error code based on the structure can determine the first field, the second field, the third field, and the fourth field, and since the four fields are generated by the service identifier, the error level, and the error category, respectively, when the four fields are obtained, the corresponding service identifier, the error level, and the error category can be determined, the service identifier indicates a specific service line, and the service identifier indicates a specific service, so that it can be known that the specific error code can represent which service of which service line has an error of which category and the error level (i.e., the severity) of the error.
In one possible example, the first field is two bits in length; the length of the second field is two bits; the third field is one bit in length; the fourth field is three bits in length.
In one possible example, the first field consists of two digits; where the numbers 00-99 are used to represent 100 services.
In one possible example, the second field consists of two digits; where the numbers 00-99 are used to represent 100 services.
In one possible example, the third field consists of a one-digit number; where the numbers 0-9 are used to indicate 10 error levels.
In one possible example, the fourth field consists of a three-digit number; where the numbers 000- > 999 are used to represent 1000 error categories.
In one possible example, the one or more programs 321 further include instructions for performing steps in a method as described below: under the condition that a second error occurs in the target system, acquiring scene information of the second error; determining a second error category of the second error corresponding to the scene information according to the scene information and a first mapping relation, wherein the first mapping relation comprises a corresponding relation between the scene information and the error category; acquiring a second error code of the second error according to the second error category; determining a second error level for the second error based on the second error code; determining a log category of the second error corresponding to the second error level according to the second error level and a second mapping relation, wherein the second mapping relation comprises a corresponding relation between the error level and the log category; and generating a service log of the second error according to the log category of the second error, and outputting the service log.
In one possible example, the one or more programs 321 further include instructions for performing steps in a method as described below: after obtaining a first error code according to the first field, the second field, the third field, and the fourth field, obtaining first prompt information according to the first error code, where the first prompt information is used to indicate the first error code and the first error; and outputting the first prompt message.
In one possible example, in the outputting the first prompt information, the instructions in the one or more programs 321 are specifically configured to: broadcasting the first prompt message through a buzzer; and/or displaying the first prompt message through a display device.
Also provided in an embodiment of the present application is a computer-readable storage medium storing a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, implement the error code generation method based on exception information as shown in the embodiment of fig. 1.
The computer readable storage medium may be an internal storage unit of the server according to any of the foregoing embodiments, for example, a hard disk or a memory of the control device. The computer-readable storage medium may also be an external storage device of the control device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the control device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the control device. The computer-readable storage medium is used to store the computer program and other programs and data required by the control device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
By way of example, the computer-readable storage medium described above may be deployed to be executed on one computer device or on multiple computer devices at one site or distributed across multiple sites and interconnected by a communication network, and the multiple computer devices distributed across the multiple sites and interconnected by the communication network may constitute a blockchain network.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An error code generation method based on abnormal information is characterized by comprising the following steps:
acquiring abnormal information of a target system, wherein the abnormal information comprises a first service identifier, a first error level and a first error category of a first error of the target system;
generating a first field according to the first service identifier;
generating a second field according to the first service identifier;
generating a third field according to the first error level;
generating a fourth field according to the first error category;
and obtaining a first error code according to the first field, the second field, the third field and the fourth field.
2. The method of claim 1, wherein the first field is two bits long; the length of the second field is two bits; the third field is one bit in length; the fourth field is three bits in length.
3. The method of claim 1 or 2, wherein the first field consists of two digits; where the numbers 00-99 are used to represent 100 services.
4. The method of claim 1 or 2, wherein the second field consists of two digits; where the numbers 00-99 are used to represent 100 services.
5. The method according to claim 1 or 2, wherein the third field consists of a one-bit number; where the numbers 0-9 are used to indicate 10 error levels.
6. The method of claim 1 or 2, wherein the fourth field consists of three digits; where the numbers 000- > 999 are used to represent 1000 error categories.
7. The method of claim 1, further comprising:
under the condition that a second error occurs in the target system, acquiring scene information of the second error;
determining a second error category of the second error corresponding to the scene information according to the scene information and a first mapping relation, wherein the first mapping relation comprises a corresponding relation between the scene information and the error category;
acquiring a second error code of the second error according to the second error category;
determining a second error level for the second error based on the second error code;
determining a log category of the second error corresponding to the second error level according to the second error level and a second mapping relation, wherein the second mapping relation comprises a corresponding relation between the error level and the log category;
and generating a service log of the second error according to the log category of the second error, and outputting the service log.
8. An error code generation apparatus based on abnormal information, the apparatus comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring abnormal information of a target system, and the abnormal information comprises a first service identifier, a first error level and a first error category of a first error of the target system;
a first field generating unit, configured to generate a first field according to the first service identifier;
a second field generating unit, configured to generate a second field according to the first service identifier;
a third field generating unit, configured to generate a third field according to the first error level;
a fourth field generating unit, configured to generate a fourth field according to the first error category;
an error code generating unit, configured to obtain a first error code according to the first field, the second field, the third field, and the fourth field.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs, the one or more programs being stored in the memory and configured to be executed by the processor, the one or more programs including instructions for performing the steps in the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the steps in the method according to any of claims 1-7.
CN202111019395.6A 2021-08-31 2021-08-31 Error code generation method, device, equipment and medium based on abnormal information Pending CN113704021A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111019395.6A CN113704021A (en) 2021-08-31 2021-08-31 Error code generation method, device, equipment and medium based on abnormal information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111019395.6A CN113704021A (en) 2021-08-31 2021-08-31 Error code generation method, device, equipment and medium based on abnormal information

Publications (1)

Publication Number Publication Date
CN113704021A true CN113704021A (en) 2021-11-26

Family

ID=78658644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111019395.6A Pending CN113704021A (en) 2021-08-31 2021-08-31 Error code generation method, device, equipment and medium based on abnormal information

Country Status (1)

Country Link
CN (1) CN113704021A (en)

Cited By (4)

* 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
CN114827247A (en) * 2022-03-26 2022-07-29 上海赛可出行科技服务有限公司 Micro-service coding method
CN115454697A (en) * 2022-09-15 2022-12-09 中航信移动科技有限公司 Information processing method and device for service exception, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002278798A (en) * 2001-03-19 2002-09-27 Canon Sales Co Inc Device and method for monitoring failure and storage medium
CN107577577A (en) * 2017-09-13 2018-01-12 郑州云海信息技术有限公司 Method, apparatus, system and the computer-readable recording medium of log-rank printing
CN110502362A (en) * 2019-08-22 2019-11-26 深圳前海环融联易信息科技服务有限公司 Error code based on micro services framework defines method, apparatus and computer equipment
CN110688285A (en) * 2019-09-30 2020-01-14 深圳前海环融联易信息科技服务有限公司 Method and device for processing abnormal classification of business system, computer equipment and storage medium
CN113098715A (en) * 2021-03-29 2021-07-09 杭州网易云音乐科技有限公司 Information processing method, device, system, medium and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002278798A (en) * 2001-03-19 2002-09-27 Canon Sales Co Inc Device and method for monitoring failure and storage medium
CN107577577A (en) * 2017-09-13 2018-01-12 郑州云海信息技术有限公司 Method, apparatus, system and the computer-readable recording medium of log-rank printing
CN110502362A (en) * 2019-08-22 2019-11-26 深圳前海环融联易信息科技服务有限公司 Error code based on micro services framework defines method, apparatus and computer equipment
CN110688285A (en) * 2019-09-30 2020-01-14 深圳前海环融联易信息科技服务有限公司 Method and device for processing abnormal classification of business system, computer equipment and storage medium
CN113098715A (en) * 2021-03-29 2021-07-09 杭州网易云音乐科技有限公司 Information processing method, device, system, medium and computing equipment

Cited By (4)

* 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
CN114827247A (en) * 2022-03-26 2022-07-29 上海赛可出行科技服务有限公司 Micro-service coding method
CN114546466A (en) * 2022-04-24 2022-05-27 广州易方信息科技股份有限公司 Error code generation method and device
CN115454697A (en) * 2022-09-15 2022-12-09 中航信移动科技有限公司 Information processing method and device for service exception, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113704021A (en) Error code generation method, device, equipment and medium based on abnormal information
CN102571403B (en) The implementation method of general data quality control adapter and device
CN108563445B (en) Application program code detection method and server
CN110554930B (en) Data storage method and related equipment
CN112631913A (en) Method, device, equipment and storage medium for monitoring operation fault of application program
CN109284331B (en) Certificate making information acquisition method based on service data resources, terminal equipment and medium
CN109902493B (en) Script issuing method and server
CN112115026A (en) Server cluster monitoring method and device, electronic equipment and readable storage medium
CN107357619B (en) Method, device, equipment and storage medium for generating card configuration file
CN117273429A (en) Event monitoring method, system, electronic equipment and storage medium
CN113986689A (en) Custom configuration alarm method, system and terminal
KR20110037969A (en) Targeted user notification of messages in a monitoring system
CN112491625A (en) Operation and maintenance alarming method, device and equipment based on instant communication platform
CN113094224B (en) Server asset management method and device, computer equipment and storage medium
CN112488325A (en) Operation and maintenance work order processing method and device, computer equipment and storage medium
CN115757107A (en) Embedded point detection method, device, server and storage medium
CN111416857A (en) Client crash processing method, device, system, equipment and storage medium
CN107341086B (en) Method and system for monitoring running state of server
CN112800130A (en) Data uplink method, system, device, equipment and storage medium
CN112035315A (en) Webpage data monitoring method and device, computer equipment and storage medium
CN111324654A (en) Interface calling method, system, computer device and computer readable storage medium
CN109271306A (en) Life test method, device, equipment and medium based on direct fault location
CN113505159B (en) Data detection method, device and equipment
CN113806196B (en) Root cause analysis method and system
CN112532721B (en) Cluster calling method and device, electronic equipment and storage medium

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20211126