Class attribute translation development method and device, equipment, medium and product
By determining the target interface based on the translation request in the class attribute translation development method, searching translation information in the preset database, and dynamically outputting the translation results, the problems of low efficiency and high maintenance costs in the existing technology are solved, and the problem of low class attribute translation efficiency and high maintenance costs in the existing technology is realized. Efficient and accurate translation result output and data management.
Patent Information
- Application Number
- CN202411416226.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-18
AI Technical Summary
The existing class attribute translation technology has problems such as inefficiency and high maintenance costs. Especially when it is necessary to frequently translate class attribute names or values, developers need to carry out a lot of coding work, which increases the development workload and the risk of errors.
A class attribute translation development method is proposed. By determining the target interface according to the request address when receiving the translation request, and retrieving translation information in the preset database, dynamically outputting the translation results. This method supports annotation injection, SQL script injection and custom interface injection, providing multi-channel translation information injection methods.
It improves the efficiency and accuracy of class attribute translation, reduces the unnecessary consumption and delay of resources, enhances the maintainability and scalability of data, and reduces the complexity of later maintenance.
Smart Images

Figure CN119473227A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a method, device, equipment, medium and product for developing class attribute translation. Background Art
[0002] In recent years, with the vigorous development of the software development industry, the complexity and scale of software products have increased day by day. The translation of class attribute names and their values has become an important part of software development. The uniformity of these class attribute translations directly affects the software development efficiency and user experience. However, the existing class attribute translation technology has many shortcomings. For example, a large amount of coding development work is required. Whenever the name or value of a class attribute needs to be translated, developers often need to define a special interface or agree with the user on the rules for translating the name and its value. When there are many class attributes that need to be translated, the development workload is significantly increased and the efficiency is reduced. Summary of the invention
[0003] The main purpose of this application is to provide a method, device, equipment, medium and product for developing class attribute translation, aiming to solve the technical problem of how to improve the efficiency of class attribute translation.
[0004] To achieve the above purpose, the present application proposes a class attribute translation development method, which includes:
[0005] When receiving a translation request for a target class attribute input from an external source, determining a target interface of a service node to be accessed according to a request address of the translation request;
[0006] If the target interface is a server interface, and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, and the first target translation information is output through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection;
[0007] If the target interface is a custom interface, second target translation information corresponding to the translation request is determined from all translation information corresponding to the custom interface, and the second target translation information is output through the custom interface.
[0008] In one embodiment, the translation information of the preset database includes first translation information, and the class attribute translation development method includes:
[0009] When the preset injection method is SQL script injection, determining the class attribute to be translated in the preset service node, and injecting the script input by the user into the preset SQL statement to obtain the SQL injection script, wherein the SQL injection script includes the first translation information of the class attribute to be translated;
[0010] Inject the SQL injection script into the preset database.
[0011] In one embodiment, the translation information of the preset database includes the second translation information, and the class attribute translation development method further includes:
[0012] When the preset injection mode is annotation injection, determine the class attribute to be translated in the preset service node, and obtain the annotation information for the class attribute injected by the user through annotation;
[0013] Parse the annotation information according to the preset parsing adapter to obtain the parsing result;
[0014] Determine a data storage format corresponding to a preset database, perform format conversion on the parsing result according to the data storage format, obtain second translation information, and store the second translation information in the preset database.
[0015] In one embodiment, all translation information corresponding to the custom interface includes the third translation information, and the class attribute translation development method further includes:
[0016] When the preset injection method is custom interface injection, the class attribute that can be injected into the custom interface in the preset service node is used as the first class attribute;
[0017] A custom interface corresponding to the custom interface injection is determined, and third translation information corresponding to the first type of attributes injected by the user through the custom interface is received, and the third translation information is associated with the first type of attributes.
[0018] In one embodiment, the target cache includes a shared cache and a server node cache. If the target interface is a server interface and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, including:
[0019] If the target interface is a server interface, determining whether first target translation information of the target class attribute exists in the server node cache;
[0020] If the first target translation information of the target class attribute does not exist in the server node cache, determining whether the first target translation information of the target class attribute exists in the shared cache;
[0021] If the first target translation information of the target class attribute does not exist in the shared cache, the first target translation information of the target class attribute is obtained from the translation information stored in the preset database, wherein the first target translation information obtained in the preset database is synchronously cached to the server node cache and the shared cache.
[0022] In one embodiment, after the step of determining whether the first target translation information of the target class attribute exists in the server node cache, the following steps are included:
[0023] If the first target translation information exists in the server node cache, outputting the first target translation information in the server node cache through the target interface;
[0024] After the step of determining whether the first target translation information of the target class attribute exists in the shared cache, the following steps are included:
[0025] If the first target translation information exists in the shared cache, the first target translation information in the shared cache is output through the target interface.
[0026] In addition, to achieve the above purpose, the present application also proposes a class attribute translation development device, which includes:
[0027] A request receiving module, when receiving a translation request for a target class attribute input from an external source, determines a target interface of a service node to be accessed according to a request address of the translation request;
[0028] The server interface module obtains the first target translation information of the target class attribute from the translation information of the preset database if the target interface is a server interface and the first target translation information of the target class attribute does not exist in the preset target cache, and outputs the first target translation information through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection;
[0029] The custom interface module determines, if the target interface is a custom interface, second target translation information corresponding to the translation request from among all translation information corresponding to the custom interface, and outputs the second target translation information through the custom interface.
[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes a class attribute translation development device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the class attribute translation development method as described above.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the class attribute translation development method as described above are implemented.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a product, which is a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the class attribute translation development method as described above are implemented.
[0033] One or more technical solutions proposed in this application have at least the following technical effects:
[0034] When receiving a translation request for a target class attribute input from the outside, the present application determines the target interface of the service node to be accessed according to the request address of the translation request, realizes accurate distribution and rapid response of the request, and avoids unnecessary consumption and delay of resources. If the target interface is a server interface, and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, and the first target translation information is output through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection; through the translation information retrieval and dynamic output of the preset database, the accuracy and timeliness of the translation information are ensured, and the maintainability and scalability of the data are enhanced. If the target interface is a custom interface, the second target translation information corresponding to the translation request is determined in all the translation information corresponding to the custom interface, and the second target translation information is output through the custom interface, showing a high degree of business adaptability and flexibility. The present application provides a multi-channel translation information injection method, so that developers can flexibly choose according to actual project requirements, increase the ease of use of the system, and improve development efficiency. When receiving a translation request, the system can quickly obtain the translation results and output them through a unified interface. This process ensures the consistency and certainty of the global translation results through a unified framework interface specification, avoids differences caused by multiple translations or translations through different channels, and improves the quality and credibility of the translation results. In summary, this application greatly improves the development efficiency of developers through the diversification of translation information injection methods, the unification of interface specifications, and the high consistency of translation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A flowchart of the first embodiment of the method for developing attribute translation for this application class;
[0038] Figure 2 An example diagram of annotation injection for the development method of the application class attribute translation;
[0039] Figure 3 A schematic diagram of the translation call for the method developed for the translation of the class attributes of this application;
[0040] Figure 4 A translation call scenario graph for the translation development method of the class attribute of this application;
[0041] Figure 5 An example diagram of the framework for developing a method for attribute translation in this application class;
[0042] Figure 6 This is a schematic diagram of the module structure of the device for class attribute translation and development according to an embodiment of the present application;
[0043] Figure 7 A schematic diagram of the device structure of the hardware operating environment involved in the class attribute translation development method in the embodiment of the present application.
[0044] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0047] The current class attribute translation technology has many shortcomings. First, a lot of coding development work is required. Whenever the name or value of a class attribute needs to be translated, developers often need to define a special interface or agree with the user on the rules for translating the name and its value, which not only increases the development workload, but also increases the risk of errors. Secondly, the cost of change maintenance is high. Since the translation of the name and value of each class attribute may be associated with different business needs and callers, when business needs change, these translations also need to be changed accordingly, which leads to an increase in the complexity of mutual calls between interfaces, and the cost of maintaining the consistency of translation within the system also increases accordingly. The current technical solutions seem to be powerless in the face of these problems, especially the lack of a general translation development architecture to constrain it in the early stages of software development, which leads to problems such as confusion in calls between back-end translation interfaces and multiple definitions, which seriously affects the software development efficiency and subsequent maintenance costs.
[0048] Therefore, in order to solve these problems, improve the efficiency of class attribute translation in software development and reduce the subsequent maintenance costs, a general class attribute translation development technology and architecture are urgently needed. This technology and architecture should be able to abstract and standardize the scenarios of class attribute names and value translation, and provide a set of public interface paradigms and tool classes, so that developers can focus more on class attribute translation itself, rather than tedious coding and development work. This embodiment provides a method based on annotations, custom interfaces, and SQL script injection to deal with various scenarios in development. The calling parties follow the interface specifications provided by the framework, so developers are more concerned about the class attribute translation itself; the subsequent maintenance cost is low. This embodiment adopts the principle of "one definition, available everywhere". For product changes, only the interface needs to be defined to achieve global maintenance.
[0049] This embodiment, with its simple and easy-to-use characteristics, significantly reduces the user's learning cost. It innovatively integrates a variety of flexible input methods such as annotations and SQL scripts, allowing users to easily inject and manage commonly used translation content, greatly improving the convenience and flexibility of translation. At the same time, this embodiment shows a high degree of openness. By building a unified translation interface, it realizes seamless docking between services and businesses, ensuring a configuration and a globally universal and efficient mode, so that it is widely applicable to various complex and changeable scenarios. In terms of stability, this embodiment cleverly uses a multi-level cache architecture composed of shared cache and local nodes, effectively alleviates the system pressure under high concurrent access, and ensures the stable operation and response speed of the system when calling the translation interface in large quantities. In addition, the architecture also gives the system good scalability, not only supports users to carry out personalized development according to actual needs, but also allows flexible pre- and post-processing of translation results, further improving the flexibility and customization of the system. In terms of code readability, this embodiment introduces an annotation mechanism to tightly bind the translation logic to the class member variables, breaking the drawbacks of the separation of translation configuration and code in the traditional method. This innovative design not only improves the readability and maintainability of the code, but also significantly improves development efficiency, allowing developers to locate and understand the translation logic more quickly, reducing the complexity of later maintenance. Finally, in terms of accuracy, this embodiment emphasizes the globally shared translation logic, ensuring that the translation conversion of all interfaces to the same value follows the same set of rules, thereby achieving a high degree of consistency and certainty in the translation results. This globally unified translation strategy effectively avoids the confusion and errors caused by inconsistent multi-source translation logic, and provides a stable and reliable translation service for the system. In summary, the class attribute translation development method of this embodiment, with its comprehensive and excellent performance, shows significant advantages in terms of ease of use, openness, stability, scalability, readability and accuracy, and is an ideal choice for building an efficient and reliable translation system.
[0050] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the system as an example to illustrate this embodiment and the following embodiments.
[0051] Based on this, this embodiment provides a class attribute translation development method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the method for developing attribute translation for this application.
[0052] In this embodiment, the class attribute translation development method includes steps S10 to S30:
[0053] Step S10, when receiving a translation request for a target class attribute input from outside, determining a target interface of a service node to be accessed according to a request address of the translation request;
[0054] It should be noted that a translation request refers to a request from within the software for translation information of a specific class attribute. These requests usually contain information such as the target field code or field name, which is used to retrieve the corresponding translation results in the database. The target class attribute is an attribute defined in the program with a specific name and value, which is the target of the translation request. A service node is a component or server in the network architecture that is responsible for processing a specific type of request, such as a translation request. The target interface is an interface defined on the service node for receiving and processing a specific type of request, in this case a translation request.
[0055] The system first receives the translation request initiated by the software through its built-in communication interface (in this embodiment, the server interface and the custom interface). These translation requests are usually initiated by another module, service or component inside the software by calling a specific function, sending a message or initiating a network request. When initiating a translation request, the initiator will clearly specify the identifier of the target class attribute (such as field name, field index, etc.), and an information containing the specific address of the translation request (such as website, message queue name and routing key, service index, etc.). According to the request address of the translation request, a set of node adaptation mechanisms is implemented inside the system to parse the request address, and determine which service node should be accessed and which target interface on the node to process the translation request. The node adaptation mechanism may be a simple matcher based on the website pattern, which checks the specific part of the request address (such as path, query parameters, etc.) to match with the predefined routing rules. In more complex cases, the routing mechanism may also involve a service registration and discovery mechanism (such as using a service registration center to dynamically query available service instances), and a load balancing algorithm (such as polling, random, minimum number of connections, etc.) to select one from multiple available service nodes. Specifically, when the system receives a translation request, it first resolves the request address and then finds the corresponding service node based on the information in the address (possibly directly or indirectly through the service registry). Once the service node is determined, the system further determines which interface on the node is responsible for processing the translation request. This is usually achieved by mapping a specific part of the request address (such as the last part of the path) to an interface name or method name defined on the service node.
[0056] Step S20, if the target interface is a server interface, and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, and the first target translation information is output through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection;
[0057] It should be noted that the preset target cache is a cache area pre-stored to improve efficiency, which is used to quickly retrieve commonly used translation information and reduce the number of database accesses. The first target translation information is a direct translation result obtained from a preset database for the target class attribute. Annotation injection is to add metadata to the code or configuration file through annotations (a special mark) in programming, and the translation information is dynamically injected according to these metadata when the system is running. In the present embodiment, it refers to the process of entering translation information in the database through SQL (Structured Query Language) scripts. The server interface is an interface pre-written by the system. There are multiple server interfaces for a service node, and there are multiple service nodes in a system.
[0058] If the target interface is a server interface, the system will first check whether the first target translation information of the target class attribute exists in the preset target cache. This step is usually implemented by querying the key-value pair of the cache, and the key may be composed of the identifier of the target class attribute and a specific prefix or suffix. If the required translation information does not exist in the cache (i.e., the cache misses), the system will turn to the preset database for search. The translation information in the database may be pre-defined in the development stage through annotations, or it may be defined by an SQL injection script obtained from a script input by the user. The system uses SQL query statements to retrieve translation information that matches the target class attribute and retrieves the results from the database. After retrieving the first target translation information of the target class attribute in the database, the system outputs the translation result to the requester through the target interface in the format expected by the requester (such as JSON (JavaScript Object Notation, JS object notation), XML (Extensible Markup Language, Extensible Markup Language)). If the request is frequent, in order to improve performance, the system may store the newly acquired translation information in the cache so that it can be quickly accessed in the future.
[0059] Step S30: If the target interface is a custom interface, second target translation information corresponding to the translation request is determined from all translation information corresponding to the custom interface, and the second target translation information is output through the custom interface.
[0060] It should be noted that the custom interface is a non-standard interface developed according to specific business requirements, and is used to process translation requests in non-general or specific scenarios. The second target translation information is the translation result that matches the current translation request, selected from all translation information associated with the custom interface.
[0061] If the target interface is a custom interface, the system will search for the second target translation information that matches the current translation request in all translation information associated with the interface according to the specific logic of the interface. The matching process may involve complex business logic and data screening. After finding the matching translation information, the system will also output the translation result to the requester through the custom interface.
[0062] For example, taking an e-commerce system as an example, when a user visits a product details page, the details page does not know what product a product information coded as 001 corresponds to. Then the details page will request the translation of the 001 code from the system, and there is a custom interface that has the translation of the code. The system will initiate a translation request containing the code details to the custom interface. The system determines the service node and target interface that handles the request through the node adaptation mechanism. The target interface is the custom interface in this example. Then the custom interface will return its own translation information to the details page, and the details page will display it to the user.
[0063] When receiving a translation request for a target class attribute input from an external source, the present embodiment determines the target interface of the service node to be accessed according to the request address of the translation request, thereby realizing accurate distribution and rapid response of the request and avoiding unnecessary consumption and delay of resources. If the target interface is a server interface and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, and the first target translation information is output through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection; the accuracy and timeliness of the translation information are ensured through the retrieval and dynamic output of the translation information of the preset database, and the maintainability and scalability of the data are enhanced. If the target interface is a custom interface, the second target translation information corresponding to the translation request is determined in all the translation information corresponding to the custom interface, and the second target translation information is output through the custom interface, showing a high degree of business adaptability and flexibility. The present embodiment provides a multi-channel translation information injection method, so that developers can flexibly choose according to actual project requirements, increase the ease of use of the system, and improve development efficiency. When receiving a translation request, the system can quickly obtain the translation results and output them through a unified interface. This process ensures the consistency and certainty of the global translation results through a unified framework interface specification, avoids differences caused by multiple translations or translations through different channels, and improves the quality and credibility of the translation results. In summary, this embodiment greatly improves the development efficiency of developers through the diversification of translation information injection methods, the unification of interface specifications, and the high consistency of translation results.
[0064] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated hereafter. On this basis, the class attribute translation development method includes steps A10 to A20:
[0065] Step A10, when the preset injection method is SQL script injection, determining the class attribute to be translated in the preset service node, and injecting the script input by the user into the preset SQL statement to obtain the SQL injection script, wherein the SQL injection script includes the first translation information of the class attribute to be translated;
[0066] Step A20, injecting the SQL injection script into the preset database.
[0067] It should be noted that the user input script is a code snippet provided by the user for performing a specific task (such as data retrieval), which is injected into SQL here. The SQL injection script is an SQL statement containing the user input script, which is used to retrieve or modify data from the database, including the first translation information of the class attribute to be translated.
[0068] The system identifies which class attributes in the preset service node need to be translated, and these attributes are the targets of data retrieval. The system prepares a preset SQL query statement template, which is designed to retrieve data from the database. The system then securely embeds the scripts entered by the user (these scripts may contain dynamically constructed query conditions or parameters) into this SQL query template to form a complete SQL injection script. The purpose of this script is to retrieve the first translation information of the class attribute to be translated from the database. The system sends the constructed SQL injection script to the preset database for execution. The database retrieves the translation information of the target class attribute from the corresponding table based on the content of the SQL statement. After the preset database executes the SQL injection script, it will store the result set of the first translation information so that it can be directly returned to the requester when receiving a translation request.
[0069] This embodiment significantly improves the efficiency and flexibility of translation information retrieval through SQL script injection. The system intelligently identifies the class attributes to be translated in the service node, and safely integrates the user input script into the preset SQL statement to form an accurate SQL injection script, which effectively extracts the first translation information. At the same time, the precise injection of this script into the database is achieved, ensuring the instant acquisition of translation information. This process not only reduces the tediousness of manually configuring queries, but also greatly improves the automation and accuracy of data retrieval, providing users with a fast and safe translation information acquisition experience.
[0070] In a feasible implementation, the class attribute translation development method may include steps B10 to B30:
[0071] Step B10, when the preset injection mode is annotation injection, determining the class attributes to be translated in the preset service node, and obtaining the annotation information for the class attributes injected by the user through annotation;
[0072] It should be noted that annotation injection is a form of dependency injection, which uses annotations in the code to declare dependencies, and the framework automatically parses the annotations at runtime or compile time to implement dependency injection and management. Annotation information is metadata attached to classes, methods, parameters, or class attributes through annotations, which is used to provide additional information or instructions for the program.
[0073] Developers annotate the translation information of class attributes in the code. These annotations contain metadata required for translation, such as field code (class attribute name), field name, field value translation entity, etc. When the program is running or compiled, the system will use the class annotation scanning module to scan the class attributes to be translated (annotated class attributes) in the preset service nodes.
[0074] Step B20, parsing the annotation information according to a preset parsing adapter to obtain a parsing result;
[0075] It should be noted that a parsing adapter is a component or tool used to convert annotation information in a specific format into a data structure or object that can be understood and used by the program. Parsing adapters include null value parsers, text parsers, text list parsers, enumeration type parsers, and interface type parsers.
[0076] The system calls the preset parsing adapter and takes the annotation information obtained in the previous step as input. The parsing adapter parses useful translation information based on the format and content of the annotation and converts it into an internal representation (such as an object, dictionary, etc.) for subsequent processing. This step is critical because it converts the metadata in the annotation into a data structure that the program can directly operate on.
[0077] For example, refer to Figure 2 , Figure 2 This is an example diagram of annotation injection. The red box 01 in the figure is an annotation script, which contains class attribute annotation information. These annotation information include field code ("state"), field name ("state"), and field value ("enumeration value"). The code in red box 02 is a parsing adapter for the annotation information in red box 01, which belongs to the enumeration adapter in the parsing adapter. When the project starts, the system will automatically parse the class attribute annotation information into translation information and store it in the database. Red box 03 is the request parameter object carried by the translation request. Red box 04 is the return parameter object sent by the system to the requester according to the request address and request parameters when receiving the translation request. When the request service node sends a request with a field code parameter to the server interface, the server interface will return the translation information corresponding to the field code parameter in the database according to the field code parameter, that is, the return parameter object in red box 04.
[0078] Step B30, determining a data storage format corresponding to a preset database, converting the format of the parsing result according to the data storage format to obtain second translation information, and storing the second translation information in the preset database.
[0079] It should be noted that the data storage format is the format or structure used to store data in the preset database, such as table structure, field type, etc. The second translation information is the parsing result after format conversion, and specifically refers to the translation information used for annotation injection and stored in the database.
[0080] The system determines the data storage format used by the preset database to store the translation information, including table name, field name, field type, etc. Next, the system converts the format of the parsing result obtained in the previous step according to this data storage format. This may include data type conversion, data cleaning, formatting and other operations to ensure that the data meets the requirements of the database. The data after format conversion, that is, the second translation information, is now ready to be stored in the database. The system sends the converted second translation information to the preset database and performs the corresponding insert or update operation. The database persists the data on the disk based on the received data and its internal data storage format. At this point, the storage process of the translation information is completed, and the translation information can be retrieved and used when needed.
[0081] This embodiment adopts the annotation injection method, which significantly optimizes the processing flow and storage efficiency of translation information. By intelligently identifying the annotation information in the service node, the attributes of the class to be translated are automatically associated without manual configuration, which greatly improves the development efficiency. Using the preset parsing adapter, the translation metadata in the annotation is accurately parsed and converted into a format that can be operated by the program, ensuring the accuracy and completeness of the information. Customized conversion is performed according to the database storage format to ensure that the second translation information is seamlessly connected to the database for efficient storage. This series of operations not only simplifies the processing flow of translation information, but also enhances the flexibility and scalability of the system, providing developers with a more convenient and efficient translation information management solution.
[0082] In a feasible implementation, the class attribute translation development method may include steps C10 to C20:
[0083] Step C10, when the preset injection mode is custom interface injection, the class attribute that can be used for custom interface injection in the preset service node is used as the first class attribute;
[0084] It should be noted that custom interface injection is a form of dependency injection in which developers define their own interfaces (different from the standard interfaces provided by the framework) and inject dependencies into classes that use them through these interfaces. This approach provides greater flexibility and control. The first type of attributes are those class attributes in the preset service nodes that are marked as supporting custom interface injection. These attributes are the targets of custom interface injection. Custom interfaces are interfaces defined by developers based on their needs to describe the interaction specifications between service nodes and external systems or components. In custom interface injection, these interfaces are used to define the format and behavior of injected data.
[0085] Developers define one or more custom interfaces that contain translation rules defined according to business requirements. The interface methods implement translation logic internally, which receives translation requests as input, processes this information according to predefined translation rules, and finally generates and returns translation information. The system will find and mark those class attributes that can be injected into the custom interface as first-class attributes. These attributes are usually identified by specific annotations, configurations, or interface implementations.
[0086] Step C20, determining a custom interface corresponding to the custom interface injection, receiving third translation information corresponding to the first type of attributes injected by the user through the custom interface, and associating the third translation information with the first type of attributes.
[0087] It should be noted that the third translation information is received through a custom interface injection method, and is the translation information associated with the first type of attribute. Such information may come from user input, external data sources, and the like.
[0088] The system associates each first-class attribute with a corresponding custom interface, which can be done by viewing the annotations, configuration files, or runtime context information of the attribute. The custom interface defines the format, method, and behavior of data exchange. The third translation information corresponding to the first-class attribute is also defined in the custom interface. This information contains translation key-value pairs, translation rules, or other forms of translation data. The system associates the received third translation information with the corresponding first-class attribute. When other modules request the third translation information, the system forwards the request to the custom interface, and then the custom interface returns the third translation information. At the same time, the custom interface can customize pre-processing and post-processing, which can be used for format conversion. For example, if the translation request requires the attribute in the translation information to be in date format, and the translation information contains attributes belonging to long integers, a function can be customized to convert the attributes belonging to long integers in the translation information into date format.
[0089] The present embodiment greatly improves the flexibility and customizability of translation information management by implementing a custom interface injection mechanism. Accurately identifying and marking the class attributes that support custom interface injection lays a solid foundation for subsequent operations, closely linking the third translation information injected by the user through the custom interface with the first type of attribute, and realizing flexible configuration and dynamic update of translation information. This process not only simplifies the processing flow of translation information, but also allows developers to customize translation rules and logic according to business needs, significantly enhancing the extensibility and adaptability of the system. At the same time, the flexible pre- and post-processing functions in the custom interface further improve the compatibility and accuracy of data, and provide users with a more efficient and accurate translation information management experience.
[0090] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first or second embodiment can be referred to the above introduction, and will not be described in detail later. Step S20 also includes steps D10 to D30:
[0091] Step D10, if the target interface is a server interface, determining whether there is first target translation information of the target class attribute in the server node cache;
[0092] It should be noted that the server node cache is a memory or fast storage area located on the server node, which is used to temporarily store frequently accessed data to reduce the number of accesses to the backend storage (such as a database) and improve data retrieval efficiency.
[0093] When processing a request for translation information of a target class attribute from a server interface (the translation information in a custom interface is not stored in the database, so there is no cache), the system first queries the server node cache to see if the first target translation information of the target class attribute has been cached. The purpose of this step is to utilize the fast access characteristics of the cache to reduce unnecessary database queries and improve response speed.
[0094] Step D20, if the first target translation information of the target class attribute does not exist in the server node cache, then determining whether the first target translation information of the target class attribute exists in the shared cache;
[0095] It should be noted that the shared cache is a cache area shared between multiple server nodes or systems, which is used to store data commonly needed by each node to achieve fast access and synchronization of data.
[0096] If the required translation information is not found in the server node cache, the system will then check the shared cache. The introduction of shared cache is to achieve data sharing and synchronization in a multi-node environment, avoiding each node from querying the database separately, reducing database load and latency.
[0097] Step D30, if the first target translation information of the target class attribute does not exist in the shared cache, the first target translation information of the target class attribute is obtained from the translation information stored in the preset database, wherein the first target translation information obtained from the preset database is synchronously cached to the server node cache and the shared cache.
[0098] If the translation information is not found in the server node cache and the shared cache, the system will retrieve the first target translation information of the target class attribute from the preset database. After the retrieval is successful, the system will cache the translation information synchronously in the server node cache and the shared cache for subsequent fast access and to reduce the number of database queries. This step embodies the idea of "caching as a service", which improves the overall performance and response speed of the system by pre-fetching and caching data.
[0099] This embodiment realizes efficient retrieval and management of target class attribute translation information by constructing a multi-layer cache mechanism. The step-by-step retrieval process from server node cache to shared cache and then to the preset database effectively reduces direct access to the database and improves the response speed. When the server interface requests translation information, the system first attempts to quickly obtain it from the server node cache. If it misses, it turns to the shared cache, further reducing the delay of cross-node queries. Finally, if both levels of cache fail to meet the demand, the system will retrieve and synchronously update the cache from the preset database, ensuring the timeliness of the data and the efficiency of access, especially when calling the translation interface in large quantities, with a certain degree of redundancy and stability.
[0100] For example, the current translation method refers to Figure 3 , Figure 3 A to F in the figure represent different service nodes, in which different translations are stored, and the arrows represent the translation call relationship between the two service nodes. Assume that A in the figure is an organization service node, which stores the translation of the organization code and its corresponding name (0001 represents the purchasing department). At this time, another service node B stores 0001. If you want to get the translation value of 0001, which is the purchasing department, you need to request service node A to get the translation value of 0001. The same is true for the translation acquisition mode between other service nodes. This requires a lot of coding development. For example, for the translation of a class attribute, you need to define a special interface or multiple users need to agree on the name and value translation. Therefore, in response to the above problems in the development process, this embodiment focuses on development efficiency and subsequent maintenance costs, and abstracts and standardizes the scenarios of class attribute name and value translation into a set of public interface paradigms. Refer to Figure 4 , Figure 4 The translation calls of all service nodes are abstracted into a unified interface specification, including single translation interface and batch translation interface. Taking the above example, service node A (as the provider of translation information) can upload its translation information (such as the mapping of organization code and name) to the unified translation service layer through annotation injection, custom interface or SQL script injection. Subsequently, any service node (such as service node B) that needs to obtain translation information only needs to initiate a request through the pre-agreed interface specification to quickly and accurately obtain the required translation results, without having to write or negotiate specific interface codes for each translation requirement.
[0101] In a feasible implementation manner, step D10 may include step D101 after step D10:
[0102] Step D101, if the server node cache has the first target translation information, then output the first target translation information in the server node cache through the target interface;
[0103] If the first target translation information exists in the server node cache, the first target translation information is retrieved from the server node cache according to the result of the cache check, and output to the requester through the target interface.
[0104] In a feasible implementation manner, step D20 may include step D201 after step D20:
[0105] Step D201: If the shared cache contains the first target translation information, the first target translation information in the shared cache is output through the target interface.
[0106] If the first target translation information exists in the shared cache, the first target translation information is retrieved from the shared cache according to the result of the cache check, and output to the requester through the target interface.
[0107] In this embodiment, if the first target translation information exists in the server node cache or the shared cache, the system will directly retrieve the first target translation information from the server node cache or the shared cache according to the result of the cache check. Subsequently, the system will also output the translation information to the requester through the target interface to ensure a timely response to the request. In this way, the system can reduce the number of accesses to the database at different levels by utilizing the strategy of multi-level cache (server node cache and shared cache), thereby speeding up the retrieval speed of the translation information and improving the user experience.
[0108] Based on any one of the first to third embodiments of the present application, in the fourth embodiment of the present application, the same or similar content as any one of the first to third embodiments can refer to the above introduction, and will not be repeated later. The class attribute translation development method also includes steps E10 to E20:
[0109] Step E10, when a translation request is obtained, pre-processing the translation request according to a preset pre-processing, and retrieving translation information from a preset database according to the pre-processed translation request;
[0110] It should be noted that after receiving the translation request, the system will perform preliminary processing or conversion on the translation request according to the preset pre-processing so that the subsequent steps can be executed more efficiently. These preset pre-processing may include data cleaning, format conversion, permission verification, etc.
[0111] When a translation request is received, the system will first perform preset pre-processing on the translation request. For example, if the translation request contains date data in a non-standard format, the system can convert it to a unified date format; if the request contains sensitive information, the system can perform desensitization processing. The purpose of pre-processing is to ensure that the data quality and format of the translation request meet the requirements of subsequent processing and reduce errors and anomalies caused by data problems. The translation request that has been pre-processed will be sent to the database, and the system will retrieve the corresponding translation results in the database based on the information in the request (such as class attribute name, field value, etc.). A large amount of translation data and rules are stored in the database, and the system uses a matching algorithm to find the translation result that best matches the translation request.
[0112] Step E20, post-processing the translation information according to a preset post-processing, and outputting the post-processed target translation result through the interface of the pre-processed translation request.
[0113] It should be noted that after obtaining the target translation results, the system will further process or optimize the results according to the preset post-processing to ensure the accuracy and usability of the output results. These preset post-processing may include format adjustment, content verification, error handling, etc.
[0114] After obtaining the target translation result, the system will perform preset post-processing on it. For example, if the target translation result contains special characters or formats, the system can format it; if the translation result needs to be verified, the system will also do it at this stage. The purpose of post-processing is to ensure the accuracy and availability of the translation results to meet the needs of users or systems. Finally, the system will output the processed target translation results to the user or system through a preset interface. The interface output can be the result returned by an API call, a file download link, or directly displayed on the user interface. The interface output is a bridge for the system to interact with users or external systems. The consistency and availability of data can be ensured through standardized interface output.
[0115] In this embodiment, the system significantly improves the processing quality and efficiency of translation requests through preset pre- and post-processing mechanisms. Pre-processing ensures the data purity and format consistency of the translation request, reducing the complexity and error rate of subsequent processing; while post-processing fine-tunes and optimizes the translation information to ensure the accuracy and availability of the output results. This process not only enhances the flexibility and configurability of the system, but also ensures the consistency and ease of use of the data through standardized interface output, providing users with a more efficient and reliable translation service experience.
[0116] In a feasible implementation manner, step E20 further includes step E201:
[0117] Step E201: if the target translation result meets the preset requirements, the target translation result is converted into a target translation result in a preset format.
[0118] It should be noted that preset requirements refer to a set of standards or rules defined by the system or user to determine whether the target translation result meets specific quality, format or content requirements. According to the preset requirements or user preferences, the output format of the translation result set by the system is the preset format.
[0119] During the translation process, the system first receives the text to be translated (source language text), and then processes it through the translation engine to generate the target translation result. Next, the system checks whether the target translation result meets the preset requirements. If the target translation result meets the preset requirements, the system will further perform the conversion step. The purpose of conversion is to convert the target translation result from the original format to the preset format.
[0120] Exemplarily, if the target translation result is in date format, and the attribute included in the target translation result is of long integer type, it is determined that the preset requirement is met, and the attribute of the target translation result of long integer type is converted into date format.
[0121] In this embodiment, the system can automatically detect and convert the target translation results that meet the preset requirements into a preset format, greatly improving the usability and user satisfaction of the translation results. This step ensures that the translation results are not only accurate in content, but also meet the format standards expected by users, such as formatted output of specific data types such as date and time. Through automatic conversion, manual intervention and error risks are reduced, processing efficiency and data consistency are improved, and users are provided with a more convenient and professional translation service experience.
[0122] It should be noted that, under the condition that the technology is feasible and the logic is clear, the above embodiments can be combined in pairs or in multiple combinations.
[0123] For example, refer to Figure 5 , Figure 5This is a framework example diagram of the class attribute translation development method, which shows the interaction and division of responsibilities between different modules within the system. It receives external translation requests for target class attributes through external interfaces and forwards them to the corresponding processing modules within the system. Forwarding is the node adapter distributing the request to the target interface in the service node to be accessed through the node dynamic URL call according to the type and content of the request. After the target interface receives the translation request, it will start the translation query module, which is responsible for processing the query request of the system field. The translation query module can query the system field or the custom field, and can also perform pre-translation processing and post-translation processing on the queried translation information. When querying, you can use cache technologies such as Redis to speed up the query process. If the required data is not in the cache, you can get it through database query. The framework supports three translation entry methods, namely annotation injection, custom interface and SQL script injection, which are implemented through three modules: class annotation scanning module, custom module and MySQL storage module. If you enter translations via annotations, the class annotation scanning module will scan these annotations in the configured scanning path when the program is running or compiled, and parse the annotations in the value parsing module. The parsing adapter will parse the translation information, store it in the MySQL storage module, and cache the translation information locally or in Redis. Parsing adapters include null value parsers, text parsers, text list parsers, enumeration type parsers, and interface type parsers. If you enter translations via a custom interface, the custom module will execute custom scripts or logic based on the translation request, such as data conversion, business rule processing, etc. If you enter translations via SQL script injection, the MySQL storage module will parse the translation information directly from the SQL script and store it.
[0124] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the attribute translation and development method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0125] This application also provides a class attribute translation development device, please refer to Figure 6 , which is set in a microservice in which a class attribute translation development toolkit is installed, and the class attribute translation development device includes:
[0126] The request receiving module 10 determines the target interface of the service node to be accessed according to the request address of the translation request when receiving the translation request for the target class attribute input from the outside;
[0127] The server interface module 20 obtains the first target translation information of the target class attribute from the translation information of the preset database if the target interface is a server interface and the first target translation information of the target class attribute does not exist in the preset target cache, and outputs the first target translation information through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection;
[0128] The custom interface module 30 determines second target translation information corresponding to the translation request from among all translation information corresponding to the custom interface if the target interface is a custom interface, and outputs the second target translation information through the custom interface.
[0129] The class attribute translation development device provided by the present application adopts the class attribute translation development method in the above embodiment, which can solve the technical problem of how to improve the efficiency of class attribute translation. Compared with the prior art, the beneficial effects of the class attribute translation development device provided by the present application are the same as the beneficial effects of the class attribute translation development method provided by the above embodiment, and other technical features in the class attribute translation development device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0130] The present application provides a class attribute translation development device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the class attribute translation development method in the above-mentioned embodiment 1.
[0131] Reference below Figure 7 , which shows a schematic diagram of a class attribute translation development device suitable for implementing the embodiment of the present application. The class attribute translation development device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The class attribute translation development device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0132] like Figure 7As shown, the class attribute translation development device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the class attribute translation development device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. Communication device 1009 can allow class attribute translation development equipment to carry out wireless or wired communication with other equipment to exchange data. Although the class attribute translation development equipment with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or less systems can be implemented or possessed alternatively.
[0133] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0134] The class attribute translation development device provided by the present application adopts the class attribute translation development method in the above embodiment, which can solve the technical problem of how to improve the efficiency of class attribute translation. Compared with the prior art, the beneficial effects of the class attribute translation development device provided by the present application are the same as the beneficial effects of the class attribute translation development method provided by the above embodiment, and other technical features in the class attribute translation development device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0135] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0136] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0137] The present application provides a medium, which is a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the class attribute translation development method in the above-mentioned embodiment.
[0138] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0139] The computer-readable storage medium may be included in the class attribute translation and development device; or may exist independently without being assembled into the class attribute translation and development device.
[0140] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the class attribute translation development device, the class attribute translation development device:
[0141] When receiving a translation request for a target class attribute input from an external source, determining a target interface of a service node to be accessed according to a request address of the translation request;
[0142] If the target interface is a server interface, and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, and the first target translation information is output through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection;
[0143] If the target interface is a custom interface, second target translation information corresponding to the translation request is determined from all translation information corresponding to the custom interface, and the second target translation information is output through the custom interface.
[0144] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0145] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0147] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned class attribute translation development method, and can solve the technical problem of how to improve the efficiency of class attribute translation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the class attribute translation development method provided by the above-mentioned embodiment, and will not be repeated here.
[0148] The present application also provides a product, which is a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the class attribute translation development method as described above are implemented.
[0149] The computer program product provided by this application can solve the technical problem of how to improve the efficiency of class attribute translation. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the class attribute translation development method provided by the above embodiment, which will not be repeated here.
[0150] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A class attribute translation development method, characterized in that: The class attribute translation development method comprises: When receiving a translation request for a target class attribute input from an external source, determining a target interface of a service node to be accessed according to a request address of the translation request; If the target interface is a server interface, and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, and the first target translation information is output through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection; If the target interface is a custom interface, second target translation information corresponding to the translation request is determined from all translation information corresponding to the custom interface, and the second target translation information is output through the custom interface.
2. The class attribute translation development method according to claim 1, characterized in that: The translation information of the preset database includes first translation information, and the class attribute translation development method includes: When the preset injection mode is SQL script injection, determining the class attribute to be translated in the preset service node, and injecting the script input by the user into the preset SQL statement to obtain the SQL injection script, wherein the SQL injection script includes the first translation information of the class attribute to be translated; Inject the SQL injection script into the preset database.
3. The class attribute translation development method according to claim 1, characterized in that: The translation information of the preset database includes second translation information, and the class attribute translation development method further includes: When the preset injection mode is annotation injection, determining the class attribute to be translated in the preset service node, and obtaining annotation information for the class attribute injected by the user through the annotation; Parsing the annotation information according to a preset parsing adapter to obtain a parsing result; A data storage format corresponding to the preset database is determined, the parsing result is format-converted according to the data storage format to obtain second translation information, and the second translation information is stored in the preset database.
4. The class attribute translation development method according to claim 1, characterized in that: All translation information corresponding to the custom interface includes the third translation information, and the class attribute translation development method further includes: When the preset injection method is custom interface injection, the class attribute that can be injected into the custom interface in the preset service node is used as the first class attribute; A custom interface corresponding to the custom interface injection is determined, and third translation information corresponding to the first type of attributes injected by a user through the custom interface is received, and the third translation information is associated with the first type of attributes.
5. The class attribute translation development method according to any one of claims 1 to 4, characterized in that: The target cache includes a shared cache and a server node cache. If the target interface is a server interface and the first target translation information of the target class attribute does not exist in the preset target cache, the first target translation information of the target class attribute is obtained from the translation information of the preset database, including: If the target interface is a server interface, determining whether the first target translation information of the target class attribute exists in the server node cache; If the first target translation information of the target class attribute does not exist in the server node cache, determining whether the first target translation information of the target class attribute exists in the shared cache; If the first target translation information of the target class attribute does not exist in the shared cache, the first target translation information of the target class attribute is obtained from the translation information stored in the preset database, wherein the first target translation information obtained from the preset database is synchronously cached in the server node cache and the shared cache.
6. The class attribute translation development method according to claim 5, characterized in that: After the step of determining whether the first target translation information of the target class attribute exists in the server node cache, the method further comprises: If the first target translation information exists in the server node cache, outputting the first target translation information in the server node cache through the target interface; After the step of determining whether the first target translation information of the target class attribute exists in the shared cache, the method further comprises: If the shared cache contains the first target translation information, the first target translation information in the shared cache is output through the target interface.
7. A class attribute translation development device, characterized in that: The microservice is configured to install a class attribute translation development toolkit, and the class attribute translation development device includes: A request receiving module, when receiving a translation request for a target class attribute input from an external source, determines a target interface of a service node to be accessed according to a request address of the translation request; A server interface module, if the target interface is a server interface and the first target translation information of the target class attribute does not exist in the preset target cache, then obtains the first target translation information of the target class attribute from the translation information of the preset database, and outputs the first target translation information through the server interface, wherein the translation information of the preset database is injected into the translation information of the class attribute according to at least one of annotation injection and SQL script injection; The custom interface module determines, if the target interface is a custom interface, second target translation information corresponding to the translation request from among all translation information corresponding to the custom interface, and outputs the second target translation information through the custom interface.
8. A class attribute translation development device, characterized in that: The class attribute translation and development device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the class attribute translation and development method according to any one of claims 1 to 6.
9. A medium, characterized in that The medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the class attribute translation development method according to any one of claims 1 to 6 are implemented.
10. A product, characterized in that The product is a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the class attribute translation development method according to any one of claims 1 to 6 are implemented.