Business state code automatic generation method and device, equipment and storage medium

By parsing and generating unique business status codes, it solves the problem of status code conflicts in a multi-person collaborative development environment, improves application maintenance efficiency and reduces maintenance costs, and ensures the integrity of business status codes and the ability to locate exceptions.

CN118733010AInactive Publication Date: 2024-10-01GUANGZHOU YIHU NETWORK TECH CO LTD

Patent Information

Application Number
CN202410682065.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In a development environment where multiple people collaborate, status code conflicts and duplications are prone to occur when data from multiple development branches is merged, which makes iteration and maintenance of business status codes difficult, reduces application maintenance efficiency and increases maintenance costs.

Method used

By receiving the code source file sent by the client, parsing the status code identification and error description information, generating a unique business status code based on the project partition table and historical status code library, and binding it with the description information to generate business status associated information. Avoid status code conflicts and improve maintenance efficiency.

Benefits of technology

It realizes the automatic generation of business status codes, avoids conflicts and duplications, improves application maintenance efficiency and reduces maintenance costs, and ensures the integrity of business status codes and the user's ability to locate abnormal situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733010A_ABST
    Figure CN118733010A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a service state code automatic generation method and device, equipment and a storage medium. The method comprises the steps that a code source file which is sent by a client and contains error description information is analyzed to obtain a state code identifier, the error description information and a service identifier; determining an affiliated section of the service identifier by querying the item partition table, and querying a historical state code of the affiliated section; identifying a description statement in the error description information, determining a statement type of the error description information according to the description statement, and selecting a coding rule associated with the statement type; generating a service state code according to the coding rule and the historical state code, and binding the service state code with the state code identifier and the error description information to generate first service state associated information; the first service state associated information is input into the syntax tree template, the first service code containing the service state code is generated, the first service code is sent to the client, iteration and maintenance of the service state code are facilitated, and the maintenance efficiency of the application program is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, device and storage medium for automatically generating a service status code. Background Art

[0002] The business status code is a code given by the server to describe the business. The business status code enables the operation and maintenance personnel to understand the status of the requested resource, such as success, error, and warning. Usually, the business status code and the description information are displayed simultaneously in the prompt information corresponding to the business resource request. For example, when a user requests to log in to a game on the client, the user receives a prompt message "Account or password error (19038)", where "Account or password error" is the description information of the business, and "19038" is the business status code. The user performs corresponding operations based on the above description information, and the operation and maintenance personnel understand the status of the requested resource based on the monitored business status code and perform corresponding maintenance on it.

[0003] In the prior art, developers need to define the value of the status code and the description information corresponding to the status code in the local development branch in advance to ensure the uniqueness and integrity of the status code in the current development branch. However, in a multi-person collaborative development environment, merging data from multiple development branches will lead to problems such as status code conflicts and duplications, which is not conducive to the iteration and maintenance of business status codes, thereby reducing the maintenance efficiency of the application and increasing the maintenance cost of the application. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, device and storage medium for automatically generating business status codes, which solves the problem of status code conflicts when multiple people merge data in multiple development branches, which is not conducive to the iteration and maintenance of business status codes, avoids the problem of business status code conflicts or duplications, is conducive to the iteration and maintenance of business status codes, improves the maintenance efficiency of applications, and reduces the maintenance cost of applications.

[0005] In a first aspect, an embodiment of the present application provides a method for automatically generating a service status code, comprising: receiving a code source file containing error description information sent by a client, parsing the code source file to obtain a status code identifier, error description information, and a service identifier;

[0006] Determine the segment to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the segment in the set project partition table, and query the historical status code of the segment to which the service identifier belongs in the historical status code library;

[0007] Perform sentence recognition on the error description information, determine the sentence type of the error description information according to the recognized description sentence, and select an associated coding rule based on the sentence type;

[0008] Generate a service status code according to the encoding rule and the historical status code, and bind the service status code with the status code identifier and the error description information to generate first service status association information;

[0009] The first service status association information is input into a set syntax tree template, a first service code including a service status code is generated, and the first service code is sent to the client.

[0010] Optionally, determining the statement type of the error description information according to the identified description statement, and selecting an associated encoding rule based on the statement type, includes:

[0011] Determine whether the identified description statement is an error description statement or a warning description statement;

[0012] In the case where the description statement is an error description statement, selecting an error coding rule associated with the error description statement;

[0013] In the case that the description statement is a warning description statement, a warning coding rule associated with the warning description statement is selected.

[0014] Optionally, the determining whether the identified description statement is an error description statement or a warning description statement includes:

[0015] Compare the identified description statements with the set error description statements and warning description statements respectively;

[0016] When the description statement is identical to any one of the error description statements, the description statement is determined to be an error description statement; and when the description statement is identical to any one of the warning description statements, the description statement is determined to be a warning description statement.

[0017] Optionally, generating a service status code according to the encoding rule and the historical status code includes:

[0018] When the selected coding rule is a warning coding rule, extracting the maximum odd status code value in the historical status code library, summing the maximum odd status code value and the preset increment value to obtain a first status code value, combining the first status code value with the segment to which the service identifier belongs to generate a first service status code;

[0019] When the selected coding rule is an incorrect coding rule, extract the maximum even status code value in the historical status code library, sum the maximum even status code value and the preset increment value to obtain a second status code value, combine the second status code value with the segment to which the service identifier belongs, and generate a second service status code.

[0020] Optionally, after sending the first service code to the client, the method further includes:

[0021] The identified description statement is compared with the preset sensitive statement. If the description statement is the same as the preset sensitive statement, the erroneous description information is replaced with the fuzzy description information according to the set fuzzy description template;

[0022] Binding the service status code with the status code identifier and the fuzzy description information to generate second service status association information;

[0023] The second service status association information is input into a set syntax tree template, a second service code including a service status code is generated, and the second service code is sent to the client.

[0024] Optionally, after sending the first service code to the client, the method further includes:

[0025] The identified description statement is compared with the preset sensitive statement. If the description statement is the same as the preset sensitive statement, the erroneous description is replaced with a fuzzy description according to a set fuzzy description template;

[0026] Binding the service status code with the status code identifier and the fuzzy description to generate second service status association information;

[0027] The second service status association information is input into a set syntax tree template, a second service code including a service status code is generated, and the second service code is sent to the client.

[0028] Optionally, before receiving the code source file containing the error description information sent by the client, the method further includes:

[0029] Receiving service association request information sent by a client, wherein the service association request information includes a service identifier to be associated and a custom section;

[0030] The segment identical to the custom segment is searched in the set project partition table. If the number of segments in the search result is zero, the service identifier to be associated is associated with the custom segment and stored in the project partition table.

[0031] Optionally, after sending the first service code to the client, the method further includes:

[0032] The historical status codes in the historical status code library are monitored by a monitoring component to obtain the number of occurrences of each historical status code within a preset time period;

[0033] Whether the business corresponding to each historical status code is abnormal is judged according to the change trend of the number of occurrences of each historical status code, and when it is determined that the business is abnormal, an alarm message is sent to the client.

[0034] In a second aspect, an embodiment of the present application provides a device for automatically generating a service status code, including:

[0035] A file parsing module, used for receiving a code source file containing error description information sent by a client, parsing the code source file to obtain a status code identifier, error description information and a service identifier;

[0036] A section determination module, used to determine the section to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the section in the set project partition table;

[0037] A historical status code query module, used to query the historical status code of the section in the historical status code library;

[0038] A statement type determination module, used to perform statement recognition on the error description information, and determine the statement type of the error description information according to the recognized description statement;

[0039] A coding rule selection module, for selecting an associated coding rule based on the statement type;

[0040] A business status code generation module, used to generate a business status code according to the encoding rule and the historical status code;

[0041] An information binding module, used to bind the service status code with the status code identifier and the error description information to generate first service status association information;

[0042] The service code generation module is used to input the first service status association information into a set syntax tree template, generate a first service code including a service status code, and send the first service code to the client.

[0043] In a third aspect, an embodiment of the present application provides a device for automatically generating a business status code, the device comprising: one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for automatically generating a business status code described in the first aspect.

[0044] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the method for automatically generating a business status code as described in the first aspect.

[0045] The embodiment of the present application receives a code source file containing error description information sent by a client, parses the code source file to obtain a status code identifier, error description information and a business identifier; determines the segment to which the business identifier belongs according to the mapping relationship between the predefined business identifier and the segment in the set project partition table, and queries the historical status code of the segment in the historical status code library; performs sentence recognition on the error description information, determines the sentence type of the error description information according to the recognized description sentence, and selects the associated coding rule based on the sentence type; generates a business status code according to the coding rule and the historical status code, binds the business status code with the status code identifier and the error description information to generate the first business status association information; inputs the first business status association information into the set syntax tree template, generates the first business code containing the business status code, and sends the first business code to the client. By recording different segments corresponding to different businesses in the project partition table, the operation and maintenance personnel can quickly determine the corresponding business according to the segment in the business status code when monitoring the prompt information, thereby improving the maintenance efficiency of the business. By determining different coding rules for different error description statement types, business status codes corresponding to different businesses can be generated regularly according to the coding rules, avoiding duplication of business status codes, and facilitating the location and management of corresponding businesses by operation and maintenance personnel. By binding the business status code with the status code identifier and error description information to generate the first business status association information, and generating the first business code based on the first business status association information, the integrity of the business prompt information received by the user can be guaranteed, making it easier for the user to understand the abnormal situation and for the operation and maintenance personnel to locate and repair the business abnormal situation. By sending the first business code to the development terminal for direct use by developers, the development efficiency of developers is improved, and the development and maintenance costs of the business are correspondingly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a flow chart of a method for automatically generating a business status code provided by an embodiment of the present application;

[0047] Figure 2 is a flowchart of a coding rule selection method provided in an embodiment of the present application;

[0048] Figure 3 This is a flow chart of a method for generating a business status code provided by an embodiment of the present application;

[0049] Figure 4 It is a flow chart of a method for generating a service code provided in an embodiment of the present application;

[0050] Figure 5 It is a structural diagram of a device for automatically generating a business status code provided in an embodiment of the present application;

[0051] Figure 6It is a structural diagram of a business status code automatic generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0054] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0055] The following, in conjunction with the accompanying drawings, describes in detail the method, device, equipment and medium for automatically generating a business status code provided by the embodiments of the present application through specific embodiments and their application scenarios.

[0056] The usage scenario of the embodiment of the present application can be that the developer predefines a set of error description information before carrying out development work, and sends the predefined error description information to the business status code generation system, which generates a business status code corresponding to each error description information and a business code containing the business status code based on the business status code generation algorithm, and sends the business code to the terminal device used by the developer, so that the developer can use the business code for subsequent development work. Based on the above usage scenario, it can be understood that the executor of this solution can be the business status code generation system.

[0057] Figure 1 is a flow chart of a method for automatically generating a service status code provided by an embodiment of the present application, such as Figure 1 As shown, including:

[0058] Step S101: receiving a code source file containing error description information sent by a client, and parsing the code source file to obtain a status code identifier, error description information, and a service identifier.

[0059] Among them, the client can be a development terminal used by developers, and the development terminal can be a laptop. The code source file is a file used to store the error content that may appear in the business to be developed predicted by the developer. The status code identifier is a constant predetermined by the developer, and the error description information can be used to indicate the error information that may appear in the business to be developed predicted by the developer, such as "account or password error", "number of login errors has reached the upper line", etc. The error description information is also predefined by the developer. Exemplarily, TypeMsgCallClientFail = "client call failure", where "CallClientFail" is the status code identifier, and "client call failure" is the error description information. The business identifier can be the business name of the business to be developed or the development account name + business name, such as https: / / github.com / wsqun / go-delay-queue, where "wsqun+go-delay-queue" can be used as the only business identifier. In one embodiment, a code source file containing error description information sent by the client is received, and the code source file is parsed by an automated generation script to obtain the status code identifier, error description information and business identifier predefined by the developer.

[0060] Step S102: determine the segment to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the segment in the set project partition table, and query the historical status code of the segment in the historical status code library.

[0061] The project partition table is a storage table for storing historical business identifiers and historical custom segments, and the project partition table can clearly indicate the mapping relationship between each historical business identifier and each historical custom segment. The segment is the business status code identifier defined by the developer for each business, and the segment can be represented by numbers or letters. For example, if the business status code is composed of a segment and an auto-increment number, the developer defines the segment of business A as 10, and the business can have 1000 business status codes, then the business status code range of the business can be 10000-10999, and different businesses correspond to different segments, so that the operation and maintenance personnel can quickly determine the business according to the segment of the business status code, so as to maintain the business. The historical status code library is a database for storing historical business status codes corresponding to different segments. All historical business status codes in the segment can be found in the historical status code library by entering the corresponding segment. In one embodiment, after determining the service identifier, the segment associated with the determined service identifier is determined according to the mapping relationship between the predefined service identifier and the segment in the project partition table, and all historical service status codes of the segment are searched in the historical service status code database according to the segment. In one embodiment, the historical status code database may also include the generation time corresponding to each historical service status code, and after determining the segment to which the service identifier belongs, the historical service status code generated most recently is searched in the historical status code database according to the segment.

[0062] Step S103: perform sentence recognition on the error description information, determine the sentence type of the error description information according to the recognized description sentence, and select an associated encoding rule based on the sentence type.

[0063] The description statement is a statement used to implement specific error content or specific operation methods, such as "Please log in again", "Signature error", etc. Statement types may include success statements, failure statements, and warning statements. Coding rules are rules used to determine the value of the business status code, such as: each time a new error description information is received, the previous historical business status code is incremented by 1. In one embodiment, the coding rule can also be pre-defined by the developer and automatically generated by the business status code generation system. Different error statement types can correspond to different coding rules. In one embodiment, the phrases or words in the parsed error description information are identified, and the sentence type described by the identified phrases or words is determined, and the coding rules associated with the statement type are selected according to the type of the statement. In a possible embodiment, the parsed error description information is sentence identified, and the identified sentence is segmented, and the sentence type of the error description information is determined based on the obtained words, so as to select the coding rules associated with the statement type according to the type of the sentence.

[0064] Step S104: Generate a service status code according to the encoding rule and the historical status code, and bind the service status code with the status code identifier and the error description information to generate first service status association information.

[0065] The business status code can be composed of a segment of the business and an auto-increment value, wherein the auto-increment value is determined according to the coding rules. The first business status association information is association information containing error description information. In one embodiment, a historical status code is determined to be generated most recently among all the historical status codes found, such as 10011, and the auto-increment value in the selected coding rule is 1. According to the above example, the first two digits "10" in the historical status code 10011 are segments, and "011" is the most recently generated status code value. Then, according to the coding rules and the historical status code, it can be determined that the generated business status code is 10012. After the business status code is generated, the business status code is bound to the parsed status code identifier and error description information to generate the first business status association information, which can be "(status code identifier: error description information: business status code)".

[0066] Step S105: input the first service status association information into a set syntax tree template, generate a first service code including a service status code, and send the first service code to the client.

[0067] The syntax tree template can be a syntax tree, which represents the syntax structure of the programming language in a tree form, and each node on the tree represents a structure in the code. The first business code is a business code containing a first business status code. In one embodiment, after receiving the first business code, the syntax tree template performs lexical analysis on the first business code, splits the content in the first business code into a token, and composes the token into a syntax tree through syntax analysis. Through semantic analysis, it is checked whether there are type mismatches or undeclared variables in this syntax tree. After the semantic analysis is completed, the first business code is generated, and the first business code is sent to the development terminal where the developer performs the development task, so that the developer can directly perform subsequent development work on the business according to the received first business code.

[0068] In the above, a code source file containing error description information sent by a client is received, and the code source file is parsed to obtain a status code identifier, error description information, and a business identifier; the segment to which the business identifier belongs is determined according to the mapping relationship between the predefined business identifier and the segment in the set project partition table, and the historical status code of the segment to which the business identifier belongs is queried in the historical status code library; the error description information is sentence-recognized, and the sentence type of the error description information is determined according to the identified description sentence, and the associated coding rule is selected based on the sentence type; the business status code is generated according to the coding rule and the historical status code, and the business status code is bound to the status code identifier and the error description information to generate the first business status association information; the first business status association information is input into the set syntax tree template, and the first business code containing the business status code is generated, and the first business code is sent to the client. By recording different sections corresponding to different businesses in the project partition table, the operation and maintenance personnel can quickly determine the corresponding business according to the section in the business status code when monitoring the prompt information, thereby improving the maintenance efficiency of the business. By determining different coding rules for different error description statement types, business status codes corresponding to different businesses can be generated regularly according to the coding rules, avoiding duplication of business status codes, and facilitating the location and management of corresponding businesses by operation and maintenance personnel. By binding the business status code with the status code identifier and error description information to generate the first business status association information, and generating the first business code based on the first business status association information, the integrity of the business prompt information received by the user can be guaranteed, making it easier for the user to understand the abnormal situation and for the operation and maintenance personnel to locate and repair the business abnormal situation. By sending the first business code to the development terminal for direct use by developers, the development efficiency of developers is improved, and the development and maintenance costs of the business are correspondingly reduced.

[0069] In one embodiment, before receiving the code source file containing the error description information sent by the client, the method further includes:

[0070] Receiving service association request information sent by a client, wherein the service association request information includes a service identifier to be associated and a custom section;

[0071] The segment identical to the custom segment is searched in the set project partition table. If the number of segments in the search result is zero, the service identifier to be associated is associated with the custom segment and stored in the project partition table.

[0072] The business association request information may be new task application information sent by the developer to the business status code generation system before the business is developed. The business association request information may include attribute information of the business. Optionally, the business association request information includes a business identifier to be associated and a custom segment. The business identifier to be associated indicates the name or ID code of the new business to be associated. The custom segment is a segment set by the developer for the business to be associated. In one embodiment, the business identifier to be associated sent by the client and the segment defined for the business are received, and a search is performed in the pre-set project partition table to find out whether there is a segment identical to the custom segment. If there is an identical segment, the segment is considered to be a repeatedly defined segment. In order to facilitate the management of the business status code and avoid repeated segments, a prompt message "segment is repeated, please redefine the segment" is sent to the development terminal used by the developer, that is, the client, until a non-repeated segment is received. If there is no custom segment identical to the segment in the project partition table, the business identifier to be associated is associated with the segment different from the project partition table and stored in the project partition table.

[0073] In the above, by receiving the business association request information sent by the client, the business association request information includes the business identifier to be associated and the custom segment, and searching the segment that is the same as the custom segment in the set project partition table. If the number of segments in the search result is zero, the business identifier to be associated is associated with the custom segment and stored in the project partition table. This allows developers to customize the segment, which is convenient for quickly locating the corresponding business according to the segment during subsequent maintenance, and also avoids duplicate partition segments in the project partition table, which is convenient for regular generation of business status codes and system management of business status codes.

[0074] In one embodiment, after sending the first service code to the client, the method further includes:

[0075] The historical status codes in the historical status code library are monitored by a monitoring component to obtain the number of occurrences of each historical status code within a preset time period;

[0076] Whether the business corresponding to each historical status code is abnormal is judged according to the change trend of the number of occurrences of each historical status code, and when it is determined that the business is abnormal, an alarm message is sent to the client.

[0077] Among them, the monitoring component is a component that monitors, stores, analyzes and queries the data of the development terminal used by the developer. In one embodiment, when the service is put into use, each service terminal will send corresponding prompt information to the development terminal while sending prompt information to the user. Therefore, after the first service status code is sent to the client, the prompt information received by the development terminal can be monitored by the monitoring component, and the monitored prompt information can be analyzed. The service corresponding to each prompt information can be analyzed according to the service status code, and the possible problems of the service can be determined according to the description information. The number of occurrences of different problems in each service and the changing trend of the number within a certain period of time are counted. If the number of occurrences of a unified problem in a unified service exceeds the set abnormal number threshold, and the abnormal number continues to increase within a certain period of time, it can be judged that the service is abnormal, and an alarm message is sent to the client to notify the relevant operation and maintenance personnel to maintain the service.

[0078] As described above, the historical status codes in the historical status code library are monitored through the monitoring component to obtain the number of occurrences of each historical status code within a preset time period; whether the business corresponding to each historical status code is abnormal is judged according to the changing trend of the number of occurrences of each historical status code, and when the business is determined to be abnormal, an alarm message is sent to the client, which can be based on automatic monitoring of the abnormal situation of each business, and promptly notify the relevant personnel for maintenance when an abnormality occurs, thereby avoiding the impact of untimely inspection by operation and maintenance personnel on user use, and correspondingly improving the maintenance efficiency of operation and maintenance personnel and reducing the maintenance cost of the business.

[0079] Figure 2 is a flowchart of a coding rule selection method provided in an embodiment of the present application, such as Figure 2 As shown, including:

[0080] Step S201: Determine whether the identified description statement is an error description statement or a warning description statement.

[0081] The error description statement is used to describe the specific error content of the user operation, such as an account error, a password error, and a signature error. The warning description statement is used to describe the warning content generated by the user operation, such as "the number of logins has reached the upper limit." In one embodiment, by identifying whether there are words indicating errors or words indicating warnings in the description statement, if there are words indicating errors, the description statement is determined to be an error statement, and if there are words indicating warnings, the description statement is determined to be a warning statement.

[0082] Optionally, the identified description statement is compared with the set error description statement and warning description statement respectively;

[0083] When the description statement is identical to any one of the error description statements, the description statement is determined to be an error description statement; and when the description statement is identical to any one of the warning description statements, the description statement is determined to be a warning description statement.

[0084] Among them, the error description statement is a preset error description model or a word indicating an error, such as the error description model can be "XXX error" or "XXX failure", etc. The word indicating an error can be "failure" or "abnormal", etc. In one embodiment, the identified description statement is compared with the preset error description statement and warning description statement respectively. If the description statement conforms to the description rules of the error description template or the words in the description statement are the same as the preset words indicating an error, the description statement is determined to be an error description statement. If the words in the description statement are the same as the preset words indicating a warning, the description statement is determined to be a warning description statement.

[0085] As described above, by comparing the description statement with the set error description statement and warning description statement respectively, the description type of the description statement can be determined quickly and accurately, thereby improving the generation efficiency of the business status code.

[0086] Step S202: When the description statement is an error description statement, select an error coding rule associated with the error description statement.

[0087] The error coding rule is a rule for generating a new business status code representing an error statement based on a historical status code in a historical status code library. The error coding rule is a coding rule predefined by a developer of a business status code generation system. In one embodiment, when the description statement is an error statement, the system automatically selects an error coding rule based on the identifier of the coding rule, thereby generating a business status code representing an error based on the error coding rule and the historical status code.

[0088] Step S203: When the description statement is a warning description statement, select a warning coding rule associated with the warning description statement.

[0089] The warning coding rule is a rule for generating a new business status code representing a warning statement based on a historical status code in a historical status code library. The warning coding rule is a coding rule predefined by a developer of a business status code generation system. In one embodiment, when the description statement is a warning statement, the system automatically selects the warning coding rule based on the identifier of the coding rule, thereby generating a business status code representing a warning based on the warning coding rule and the historical status code.

[0090] In the above, by judging whether the identified description statement is an error description statement or a warning description statement, if the description statement is an error description statement, the error coding rule associated with the error description statement is selected, and if the description statement is a warning description statement, the warning coding rule associated with the warning description statement is selected. Different coding rules can be selected according to different statement types, so that the operation and maintenance personnel can not only determine the abnormal business based on the generated business status code, but also determine the abnormal situation that may exist in the business based on the generated business status code, thereby improving the maintenance efficiency of the operation and maintenance personnel.

[0091] Figure 3 is a flow chart of a method for generating a service status code provided by an embodiment of the present application, such as Figure 3 As shown, including:

[0092] Step S301: When the selected coding rule is a warning coding rule, extract the maximum odd status code value in the historical status code library, sum the maximum odd status code value and the preset increment value to obtain a first status code value, combine the first status code value with the segment to which the business identifier belongs, and generate a first business status code.

[0093] Among them, the first status code value is a value calculated according to the warning coding rule. Exemplarily, if the historical status codes in the historical status code library are 10001, 10002, 10003, and 10004, respectively, the maximum odd status code value in the historical status code library is extracted, that is, 10003. Since the error statement type or warning statement type represented by the business status code is determined by judging whether the status code value is an odd number or an even number in this scheme, the increment value can be pre-set to 2, and then the first status code value at this time is: 003+2=005. Since the first business status code is composed of a segment and a first status code value, that is, the segment "10" and the first status code value "005" are combined to generate a first business status code of 10005. The operation and maintenance personnel can determine that the last digit is an odd number based on the first business status code, the coding rule is a warning coding rule, and the error description statement is a warning statement.

[0094] Step S302: When the selected coding rule is an incorrect coding rule, extract the maximum even status code value in the historical status code library, sum the maximum even status code value and the preset increment value to obtain a second status code value, combine the second status code value with the segment to which the service identifier belongs, and generate a second service status code.

[0095] Among them, the second status code value is a value calculated according to the error coding rule. Exemplarily, if the historical status codes in the historical status code library are 10001, 10002, 10003, and 10004, respectively, then the maximum even status code value in the historical status code library is extracted, that is, 10004. Since the error statement type or warning statement type represented by the business status code is determined by judging whether the status code value is an odd number or an even number in this scheme, the increment value can be pre-set to 2, and then the second status code value at this time is: 004+2=006. Since the second business status code is composed of a segment and a second status code value, that is, the segment "10" and the second status code value "006" are combined to generate the first business status code of 10006. The operation and maintenance personnel can determine that the last digit is an even number based on the second business status code, the coding rule is an error coding rule, and the error description statement is an error statement.

[0096] As described above, by selecting different encoding rules to generate status code values ​​and service status codes with different last digit types, operation and maintenance personnel can quickly determine possible abnormal situations of the service, thereby improving the maintenance efficiency of operation and maintenance personnel.

[0097] Figure 4 is a flow chart of a method for generating a service code provided in an embodiment of the present application, such as Figure 4 As shown, including:

[0098] Step S401: receiving a code source file containing error description information sent by a client, and parsing the code source file to obtain a status code identifier, error description information, and a service identifier.

[0099] Step S402: determine the segment to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the segment in the set project partition table, and query the historical status code of the segment in the historical status code library.

[0100] Step S403: perform sentence recognition on the error description information, determine the sentence type of the error description information according to the recognized description sentence, and select an associated encoding rule based on the sentence type.

[0101] Step S404: Generate a service status code according to the encoding rule and the historical status code, and bind the service status code with the status code identifier and the error description information to generate first service status association information.

[0102] Step S405: input the first service status association information into a set syntax tree template, generate a first service code including a service status code, and send the first service code to the client.

[0103] Step S406: compare the identified description statement with the preset sensitive statement. If the description statement is the same as the preset sensitive statement, replace the erroneous description information with fuzzy description information according to the set fuzzy description template.

[0104] The preset sensitive statements are used to represent the actual error content, such as "json data parsing failed", "XX interface data call failed". Fuzzy description is a description method that does not specify the specific cause of the error, such as "the account cannot be logged in, please consult the customer for the specific reason", which describes the result of the user's failed login operation and does not display the specific reason for the login failure. In one embodiment, the identified description statement is compared with the preset sensitive statement to determine whether the currently identified description statement is a sensitive statement. If it is a sensitive statement, the fuzzy description template is used to replace the sensitive statement with a fuzzy statement. Exemplarily, if the identified description statement is "incorrect password", the description statement is input into the fuzzy description template, and the fuzzy description information of "the account cannot be logged in, please consult the customer for the specific reason" is output.

[0105] Step S407: Bind the service status code, the status code identifier and the fuzzy description information to generate second service status association information.

[0106] The second service status association information is association information including a fuzzy description. In one embodiment, after the fuzzy description information is input, the service status code is bound to the status code identifier obtained by parsing and the fuzzy description information obtained to generate the second service status association information, which may be "(status code identifier: fuzzy description information: service status code)".

[0107] Step S408: input the second service status association information into a set syntax tree template, generate a second service code including a service status code, and send the second service code to the client.

[0108] In one embodiment, after receiving the second business code, the syntax tree template performs lexical analysis on the second business code, splits the content in the second business code into a token, and composes the token into a syntax tree through grammatical analysis. It checks whether there are type mismatches or undeclared variables in the syntax tree through semantic analysis. After the semantic analysis is completed, the second business code is generated and sent to the development terminal where the developer performs the development task, so that the developer can directly perform subsequent development work on the business based on the received second business code.

[0109] As described above, the identified description statement is compared with the preset sensitive statement. When the description statement is the same as the preset sensitive statement, the error description is replaced with a fuzzy description according to the set fuzzy description template, the business status code is bound to the status code identifier and the fuzzy description, and the second business status association information is generated. The second business status association information is input into the set syntax tree template, and a second business code containing the business status code is generated, and the second business code is sent to the client. By replacing the identified error description information containing sensitive information with fuzzy description information, it is possible to prevent lawbreakers from damaging the corresponding business based on the error description information, thereby ensuring the security of business data, and at the same time, it will not affect the operation and maintenance personnel's rapid positioning and maintenance of abnormal business.

[0110] Figure 5 is a schematic diagram of the structure of a device for automatically generating a service status code provided in an embodiment of the present application, such as Figure 5 As shown, including:

[0111] The file parsing module 51 is used to receive a code source file containing error description information sent by a client, and parse the code source file to obtain a status code identifier, error description information and a service identifier;

[0112] The section determination module 52 is used to determine the section to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the section in the set project partition table;

[0113] A historical status code query module 53, used to query the historical status code of the section in the historical status code library;

[0114] A statement type determination module 54 is used to perform statement recognition on the error description information and determine the statement type of the error description information according to the recognized description statement;

[0115] A coding rule selection module 55, which selects an associated coding rule based on the statement type;

[0116] A service status code generating module 56, configured to generate a service status code according to the encoding rule and the historical status code;

[0117] An information binding module 57, used to bind the service status code with the status code identifier and the error description information to generate first service status association information;

[0118] The service code generating module 58 is used to input the first service status association information into a set syntax tree template, generate a first service code including a service status code, and send the first service code to the client.

[0119] In the above, a code source file containing error description information sent by a client is received, and the code source file is parsed to obtain a status code identifier, error description information, and a business identifier; the segment to which the business identifier belongs is determined according to the mapping relationship between the predefined business identifier and the segment in the set project partition table, and the historical status code of the segment to which the business identifier belongs is queried in the historical status code library; the error description information is sentence-recognized, and the sentence type of the error description information is determined according to the identified description sentence, and the associated coding rule is selected based on the sentence type; the business status code is generated according to the coding rule and the historical status code, and the business status code is bound to the status code identifier and the error description information to generate the first business status association information; the first business status association information is input into the set syntax tree template, and the first business code containing the business status code is generated, and the first business code is sent to the client. By recording different sections corresponding to different businesses in the project partition table, the operation and maintenance personnel can quickly determine the corresponding business according to the section in the business status code when monitoring the prompt information, thereby improving the maintenance efficiency of the business. By determining different coding rules for different error description statement types, business status codes corresponding to different businesses can be generated regularly according to the coding rules, avoiding duplication of business status codes, and facilitating the location and management of corresponding businesses by operation and maintenance personnel. By binding the business status code with the status code identifier and error description information to generate the first business status association information, and generating the first business code based on the first business status association information, the integrity of the business prompt information received by the user can be guaranteed, making it easier for the user to understand the abnormal situation and for the operation and maintenance personnel to locate and repair the business abnormal situation. By sending the first business code to the development terminal for direct use by developers, the development efficiency of developers is improved, and the development and maintenance costs of the business are correspondingly reduced.

[0120] In a possible embodiment, the encoding rule selection module 54 is used to:

[0121] Determine whether the identified description statement is an error description statement or a warning description statement;

[0122] In the case where the description statement is an error description statement, selecting an error coding rule associated with the error description statement;

[0123] In the case that the description statement is a warning description statement, a warning coding rule associated with the warning description statement is selected.

[0124] In a possible embodiment, the statement type determination module 54 is used to:

[0125] Compare the identified description statements with the set error description statements and warning description statements respectively;

[0126] When the description statement is identical to any one of the error description statements, the description statement is determined to be an error description statement; and when the description statement is identical to any one of the warning description statements, the description statement is determined to be a warning description statement.

[0127] In a possible embodiment, the service code generation module 58 is used to:

[0128] When the selected coding rule is a warning coding rule, extracting the maximum odd status code value in the historical status code library, summing the maximum odd status code value and the preset increment value to obtain a first status code value, combining the first status code value with the segment to which the service identifier belongs to generate a first service status code;

[0129] When the selected coding rule is an incorrect coding rule, extract the maximum even status code value in the historical status code library, sum the maximum even status code value and the preset increment value to obtain a second status code value, combine the second status code value with the segment to which the service identifier belongs, and generate a second service status code.

[0130] In a possible embodiment, the description information replacement module is used to:

[0131] The identified description statement is compared with the preset sensitive statement. If the description statement is the same as the preset sensitive statement, the erroneous description information is replaced with the fuzzy description information according to the set fuzzy description template;

[0132] The information binding module 57 is used to: bind the service status code with the status code identifier and the fuzzy description to generate second service status association information;

[0133] The service code generation module 58 is used to: input the second service status association information into a set syntax tree template, generate a second service code including a service status code, and send the second service code to the client.

[0134] In a possible embodiment, the information binding module 57 is further used to:

[0135] Receiving service association request information sent by a client, wherein the service association request information includes a service identifier to be associated and a custom section;

[0136] The segment identical to the custom segment is searched in the set project partition table. If the number of segments in the search result is zero, the service identifier to be associated is associated with the custom segment and stored in the project partition table.

[0137] In a possible embodiment, the status code monitoring module is used to:

[0138] The historical status codes in the historical status code library are monitored by a monitoring component to obtain the number of occurrences of each historical status code within a preset time period;

[0139] Whether the business corresponding to each historical status code is abnormal is judged according to the change trend of the number of occurrences of each historical status code, and when it is determined that the business is abnormal, an alarm message is sent to the client.

[0140] The embodiment of the present application also provides a device for automatically generating a business status code, and the device for automatically generating a business status code can be integrated with a device for automatically generating a business status code provided in the embodiment of the present application. Figure 6 This is a schematic diagram of the structure of a device for automatically generating a service status code provided in an embodiment of the present application, with reference to Figure 6 The service status code automatic generation device includes: an input device 63, an output device 64, a memory 62 and one or more processors 61; the memory 62 is used to store one or more programs; when one or more programs are executed by one or more processors 61, the one or more processors 61 implement the service status code automatic generation method provided in the above embodiment. The input device 63, the output device 64, the memory 62 and the processor 61 can be connected by a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0141] The memory 62, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the automatic generation method of the business status code provided in any embodiment of the present application. The memory 62 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application required for a function; the storage data area may store data created according to the use of the device, etc. In addition, the memory 62 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 62 may further include a memory remotely arranged relative to the processor 61, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0142] The input device 63 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 64 may include a display device such as a display screen.

[0143] The processor 61 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 62, that is, implements the above-mentioned automatic generation method of the service status code.

[0144] The above-provided business status code automatic generation device, equipment and computer can be used to execute the business status code automatic generation method provided by any of the above-mentioned embodiments, and have corresponding functions and beneficial effects.

[0145] The embodiment of the present application further provides a storage medium storing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute the automatic generation method of the service status code provided in the above embodiment. The automatic generation method of the service status code includes:

[0146] Receiving a code source file containing error description information sent by a client, parsing the code source file to obtain a status code identifier, error description information, and a service identifier;

[0147] Determine the segment to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the segment in the set project partition table, and query the historical status code of the segment to which the service identifier belongs in the historical status code library;

[0148] Perform sentence recognition on the error description information, determine the sentence type of the error description information according to the recognized description sentence, and select an associated coding rule based on the sentence type;

[0149] Generate a service status code according to the encoding rule and the historical status code, and bind the service status code with the status code identifier and the error description information to generate first service status association information;

[0150] The first service status association information is input into a set syntax tree template, a first service code including a service status code is generated, and the first service code is sent to the client.

[0151] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0152] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the automatic generation method of the business status code as described above, can also execute the relevant operations in the automatic generation method of the business status code provided in any embodiment of the present application.

[0153] The business status code automatic generation device, equipment and storage medium provided in the above embodiments can execute the business status code automatic generation method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the business status code automatic generation method provided in any embodiment of the present application.

[0154] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A method for automatically generating a business status code, characterized in that: include: Receiving a code source file containing error description information sent by a client, parsing the code source file to obtain a status code identifier, error description information, and a service identifier; Determine the segment to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the segment in the set project partition table, and query the historical status code of the segment to which the service identifier belongs in the historical status code library; Perform sentence recognition on the error description information, determine the sentence type of the error description information according to the recognized description sentence, and select an associated coding rule based on the sentence type; Generate a service status code according to the encoding rule and the historical status code, and bind the service status code with the status code identifier and the error description information to generate first service status association information; The first service status association information is input into a set syntax tree template, a first service code including a service status code is generated, and the first service code is sent to the client.

2. The method for automatically generating a service status code according to claim 1, characterized in that: The step of determining the sentence type of the error description information according to the identified description sentence, and selecting an associated coding rule based on the sentence type, includes: Determine whether the identified description statement is an error description statement or a warning description statement; In the case where the description statement is an error description statement, selecting an error coding rule associated with the error description statement; In the case that the description statement is a warning description statement, a warning coding rule associated with the warning description statement is selected.

3. According to the method for automatically generating a service status code according to claim 2, it is characterized in that: The determining whether the identified description statement is an error description statement or a warning description statement includes: Compare the identified description statements with the set error description statements and warning description statements respectively; When the description statement is identical to any one of the error description statements, the description statement is determined to be an error description statement; and when the description statement is identical to any one of the warning description statements, the description statement is determined to be a warning description statement.

4. The method for automatically generating a service status code according to claim 2, characterized in that: The generating of the service status code according to the encoding rule and the historical status code comprises: When the selected coding rule is a warning coding rule, extracting the maximum odd status code value in the historical status code library, summing the maximum odd status code value and the preset increment value to obtain a first status code value, combining the first status code value with the segment to which the service identifier belongs to generate a first service status code; When the selected coding rule is an incorrect coding rule, extract the maximum even status code value in the historical status code library, sum the maximum even status code value and the preset increment value to obtain a second status code value, combine the second status code value with the segment to which the service identifier belongs, and generate a second service status code.

5. The method for automatically generating a service status code according to claim 1, characterized in that: After sending the first service code to the client, the method further includes: The identified description statement is compared with the preset sensitive statement. If the description statement is the same as the preset sensitive statement, the erroneous description information is replaced with the fuzzy description information according to the set fuzzy description template; Binding the service status code with the status code identifier and the fuzzy description information to generate second service status association information; The second service status association information is input into a set syntax tree template, a second service code including a service status code is generated, and the second service code is sent to the client.

6. The method for automatically generating a service status code according to claim 1, characterized in that: Before receiving the code source file containing the error description information sent by the client, the method further includes: Receiving service association request information sent by a client, wherein the service association request information includes a service identifier to be associated and a custom section; The segment identical to the custom segment is searched in the set project partition table. If the number of segments in the search result is zero, the service identifier to be associated is associated with the custom segment and stored in the project partition table.

7. The method for automatically generating a service status code according to claim 1, characterized in that: After sending the first service code to the client, the method further includes: The historical status codes in the historical status code library are monitored by a monitoring component to obtain the number of occurrences of each historical status code within a preset time period; Whether the business corresponding to each historical status code is abnormal is judged according to the change trend of the number of occurrences of each historical status code, and when it is determined that the business is abnormal, an alarm message is sent to the client.

8. A device for automatically generating a service status code, characterized in that: include: A file parsing module, used for receiving a code source file containing error description information sent by a client, parsing the code source file to obtain a status code identifier, error description information and a service identifier; A section determination module, used to determine the section to which the service identifier belongs according to the mapping relationship between the predefined service identifier and the section in the set project partition table; A historical status code query module, used to query the historical status code of the section in the historical status code library; A statement type determination module, used to perform statement recognition on the error description information, and determine the statement type of the error description information according to the recognized description statement; A coding rule selection module, for selecting an associated coding rule based on the statement type; A business status code generation module, used to generate a business status code according to the encoding rule and the historical status code; An information binding module, used to bind the service status code with the status code identifier and the error description information to generate first service status association information; The service code generation module is used to input the first service status association information into a set syntax tree template, generate a first service code including a service status code, and send the first service code to the client.

9. A device for automatically generating a service status code, the device comprising: one or more processors; A storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for automatically generating a business status code as described in any one of claims 1 to 7.

10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method for automatically generating a service status code according to any one of claims 1 to 7 when executed by a computer processor.

Citation Information

Patent Citations

  • Processing method and device for monitoring system status code data, equipment and medium

    CN115277355A

  • Anti-sniffing method and device, terminal equipment and computer readable storage medium

    CN115378723A

  • Business processing method and device, equipment and storage medium

    CN116708564A

  • Monitoring / analyzing apparatus, monitoring / analyzing method and program

    US20090193115A1

Cited By

  • AI workflow model transaction platform secrecy method and system

    CN120074965A