Method, device and computer-readable medium for rapidly encapsulating ID value translation results
By defining the translation set attributes in the return object of the query interface and using the processing class in the annotation to find the translation results of the ID value, the problem of poor translation performance in the prior art is solved, and the translation results of the ID value are quickly encapsulated and multiplexed.
Patent Information
- Application Number
- CN202111645665.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the field of big data application, especially in the field of medical data, the ID value or code value stored in the database needs to be translated into a specific meaning, but in the prior art, business code and translation code are coupled deeply, maintenance is difficult, and serial processing leads to poor query interface performance.
By defining the return object of the query interface, the target class includes the translation collection attribute, the processing class in the annotation finds the translation results of the ID value, and writes the results into the translation collection attribute of the query result object, thereby quickly encapsulating the translation results of the ID value.
This method can quickly obtain translation results of ID values, reduce the coupling between business code and translation code, improve query performance, and optimize the multiplexing of translation results through cache.
Smart Images

Figure CN114356973B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of databases, and in particular to a method, a device and a computer-readable medium for rapidly encapsulating ID value translation results. Background Art
[0002] In the application field of big data, data in the medical field has the characteristics of huge quantity, multiple sources and strong volatility. Data from different business systems are stored in the database. There is a certain correlation between multiple databases. In order to improve storage efficiency, some unified information is stored in a specific database. For example, address information is stored in the regional library, and hospital name information is stored in the dictionary library. The ID value or code value of the data is stored in the database of the business system. Different ID values or code values have corresponding meanings. For example, the ID value of the address is "123", and the corresponding meaning is "Shanghai City". This correspondence is stored in the regional library. When querying related data in the business system, the query result is usually an ID value or code value. In order to obtain the specific meaning of the ID value or code value, it is necessary to query its meaning one by one according to the ID value or code value in the business logic, obtain the text description of the ID value or code value, and then add translation code in the business code to assign the text description to the return object of the query operation. This method has the following disadvantages:
[0003] (1) The original business code and the translated code are deeply coupled, making maintenance difficult;
[0004] (2) Each attribute field that needs to be translated in the returned object is processed serially. When there are many attribute fields that need to be translated, the query interface performance will be poor. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method, device and computer-readable medium for rapidly encapsulating ID value translation results.
[0006] The technical solution adopted by the present invention to solve the above technical problems is a method for quickly encapsulating ID value translation results, comprising: defining a return object of a query interface including a target class, the target class including a translation set attribute; receiving a query input through the query interface, obtaining a query result according to the query input, the query result including an ID value to be translated, the ID value corresponding to an attribute, when a query result object corresponding to the query result belongs to the target class, obtaining an annotation from the query result object, the annotation including a processing class, the processing class being used to find the translation result of the ID value corresponding to the attribute; running the processing class to obtain the translation result; and writing the translation result into the translation set attribute of the query result object.
[0007] In one embodiment of the present invention, the target class is a data transfer object base class.
[0008] In an embodiment of the present invention, the translation set attribute includes a key-value pair; the step of writing the translation result into the translation set attribute includes: writing the name of the attribute into the key of the translation set attribute, and writing the translation result into the value of the translation set attribute.
[0009] In one embodiment of the present invention, before the step of running the processing class, it also includes: grouping the query results according to the search object of the processing class, and grouping the query results of the processing class with the same search object into one group; the step of running the processing class includes: running the processing classes in different groups in parallel.
[0010] In one embodiment of the present invention, the search object includes a database or a third-party service.
[0011] In one embodiment of the present invention, the database includes a regional library or a dictionary library.
[0012] In one embodiment of the present invention, when a plurality of query results are obtained, before executing the processing class step, it further includes: aggregating the ID values of the attributes having the same search object.
[0013] In one embodiment of the present invention, the method further includes: storing the translation result in a cache.
[0014] To solve the above technical problems, the present invention also proposes a device for quickly encapsulating ID value translation results, comprising: a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement the above method.
[0015] To solve the above technical problem, the present invention further provides a computer-readable medium storing computer program codes, wherein the computer program codes implement the above method when executed by a processor.
[0016] The present invention defines that the return object of the query interface includes a translation set attribute, and writes the translation result into the translation set attribute of the query result, so that the translation result of the ID value can be quickly obtained; by aggregating multiple ID values belonging to the same type of attribute, a batch of translation results can be obtained from a database in batches, thereby improving the query speed; by grouping the query results according to the search object of the processing class, and running the processing classes in different groups in parallel, the translation results of the ID values in each group can be queried in batches, thereby further improving the query performance; and by storing the translation results in a cache, it is beneficial to reuse the translation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein:
[0018] Figure 1 is an exemplary flow chart of a query method for quickly obtaining ID value translation results according to an embodiment of the present invention;
[0019] Figure 2 is an exemplary flow chart of a query method for quickly obtaining ID value translation results according to another embodiment of the present invention;
[0020] Figure 3 It is a system block diagram of a query device for quickly obtaining ID value translation results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0022] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0023] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0024] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values of the parts and steps set forth in these embodiments do not limit the scope of the present application. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to those of ordinary skill in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be considered as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so that once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.
[0025] In addition, it should be noted that the use of words such as "first" and "second" to define components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above words have no special meaning and cannot be understood as limiting the scope of protection of this application. In addition, although the terms used in this application are selected from well-known and commonly used terms, some terms mentioned in the specification of this application may be selected by the applicant at his or her discretion, and their detailed meanings are explained in the relevant parts of the description of this article. In addition, it is required to understand this application not only by the actual terms used, but also by the meaning implied by each term.
[0026] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously. At the same time, other operations may be added to these processes, or one or more operations may be removed from these processes.
[0027] When querying the database through different business systems, the query results obtained are often digital results, such as the ID number of the hospital name, the number of the project sponsor, the code of the disease, etc. If you want to obtain the text description corresponding to these digital results, you need to further search in the database. The method for quickly encapsulating the translation result of the ID value of the present invention can be written into the annotation. The processing class is run to obtain the translation result of the ID value, and the translation result is encapsulated in the translation collection attribute of the returned object, so as to quickly obtain the translation result and realize the reuse of the translation result.
[0028] Figure 1 It is an exemplary flow chart of a method for rapidly encapsulating ID value translation results according to an embodiment of the present invention.
[0029] refer to Figure 1 As shown, the method of this embodiment includes the following steps:
[0030] Step S110: define that the return object of the query interface includes a target class, and the target class includes a translation set attribute;
[0031] Step S120: receiving a query input through a query interface, obtaining a query result according to the query input, wherein the query result includes an ID value to be translated, the ID value corresponds to an attribute, and when a query result object corresponding to the query result belongs to a target class, obtaining an annotation from the query result object, the annotation including a processing class, and the processing class is used to find a translation result of the ID value corresponding to the attribute;
[0032] Step S130: running the processing class to obtain the translation result; and
[0033] Step S140: writing the translation result into the translation collection attribute of the query result object.
[0034] The above steps S110 - S140 are described below with reference to specific examples.
[0035] In step S110, the query interface is first standardized and defined, including defining the return object of the query interface, so that the return object includes a target class, and the target class includes a translation collection attribute. In some embodiments, the target class is a data transfer object base class, represented by BaseDTO. The BaseDTO is a data transfer object (DataTransfer Object, DTO), which is suitable for data encapsulation of domain objects and realizing data transfer between layers. In step S110, the return object of the query interface is defined to include a target class, which also means that the class of the return object inherits from the data transfer object base class.
[0036] In this specification, translateMap is used to represent the translation collection attribute. The target class includes a translation collection attribute representation, and the BaseDTO base class includes a translateMap attribute, which is used to store the translation result of the ID value in subsequent steps.
[0037] In step S120, a query input is received, and the query input comes from a business system, which is not limited in the present invention. The data object structure of the query result is different depending on the business system.
[0038] In step S120, the query result object can be intercepted by calling the aspect program, and it is determined whether the query result object belongs to the target class defined in step S110. If the query result object corresponding to the query result belongs to the target class, the annotation is obtained from the query result object. The annotation includes a processing class, which is used to find the translation result of the ID value corresponding to the attribute. Specifically, the present invention intercepts the controller layer through an AOP (Aspect Oriented Programming) program, and the AOP interception program can be set anywhere in the main program. By intercepting the query result object, the translation result of the ID value in the query result can be obtained by running the processing class before the query result is returned to the user, and the translation result is encapsulated in the translation set attribute, and then the translation result is returned to the user, so that the user can obtain the translation result while obtaining the query result without executing the translation step. In step S120, one or more query results can be obtained according to the query input. Each query result includes one or more ID values to be translated. For example, if the query input is "Shanghai First People's Hospital", a query result is obtained, which may include one or more ID values; if the query input is "all hospitals in Shanghai", multiple query results are obtained, including multiple ID values, and these query results are a list.
[0039] Each ID value in the query result corresponds to an attribute. For medical data, the attributes include, for example, hospital name, province, level, etc. For example, for the query input "Shanghai First People's Hospital", in the query result, the ID value of the hospital name is 101, the ID value of the province is 201, and the ID value of the level is 301. These ID values are usually returned to the user as query results. For example, the query result can be:
[0040] {"ProvinceId":"123"}
[0041] The query result shows that an attribute "ProvinceId" of the query result has an ID value of "123", and does not contain a text description corresponding to the ID value.
[0042] If users want to obtain the actual meaning of these ID values, they need to query the database or service corresponding to each attribute, which is inefficient. In addition, the query performance is low if the query method is used one by one.
[0043] The present invention adds annotations to attributes, marks processing classes in the annotations, and searches for translation results of ID values corresponding to the attributes by directly calling the processing classes, so as to quickly obtain translation results of relevant ID values. It is understandable that corresponding annotations can be added in advance for different attributes.
[0044] In step S110, when the query interface is standardized, it may also include: using a custom annotation for the attribute to be translated, the custom annotation includes a processing class for querying the attribute to obtain the translation result. The user may add annotations to certain attributes as needed.
[0045] In some embodiments, Java annotations are used to mark the processing class corresponding to an attribute. An example of an annotation is given below:
[0046] @Translate(value=PositionCodeTranslator.class)
[0047] Among them, PositionCodeTranslator.class is the processing class corresponding to this attribute.
[0048] In some embodiments, the annotation also includes a mark indicating whether the attribute needs to be translated. When obtaining the query result, the annotation of a certain attribute is read. If the attribute needs to be translated, the annotation also includes the corresponding processing class; if the attribute does not need to be translated, the annotation does not include the corresponding processing class.
[0049] Here is an example of a processing class:
[0050] Public interface TranslateHandler{
[0051] String translate(String translateId);
[0052] Map<String,String> multiTranslate(List <object>translates);
[0053] }
[0054] By calling the processing class, the translation result of the ID value corresponding to the attribute can be found in the search object related to the attribute.
[0055] In some embodiments, the search object includes a database or a third-party service.
[0056] In some embodiments, the database includes a regional library or a dictionary library. For medical data, the regional library refers to a database that stores ID values and text descriptions related to addresses. For example, the following table 1 is an example of partial content of a form in a regional library:
[0057] Table 1:
[0058]
[0059]
[0060] Table 1 shows that the text description corresponding to ID value 1 is "China", and so on. Type in Table 1 corresponds to the attribute of the query result. For example, if Type is Country, the attribute name in the query result is CountryID; if Type is Province, the attribute name in the query result is ProvinceID; if Type is City, the attribute name in the query result is CityID. Since countries, provinces, and cities are all regional features, they are all stored in the same regional library.
[0061] Continuing with the previous example, in step S120, the query results returned according to the query input include, for example:
[0062] {"ProvinceId":"123"}
[0063] At the same time, the annotation of the ProvinceId attribute marks its processing class as PositionCodeTranslator.class, so in step S130, the processing class is run. The processing class will execute to obtain the Name value of ProvinceId 123, that is, "Henan Province" from the regional library. "Henan Province" is the translation result.
[0064] The database where the data is stored is related to the attributes of the data. For example, as shown in Table 1, the attributes CountryID, ProvinceID, and CityID all correspond to the regional database, and the same annotation can be used for these attributes, including the same processing class.
[0065] The dictionary library may be a database including some medical Code values. For example, if a query result includes the attribute drugCode, then it is necessary to find the drugName corresponding to the drugCode in the dictionary library.
[0066] In step S140, the translation result is written into the translation collection attribute of the query result object.
[0067] Since the query result object belongs to or inherits from the data transfer object base class, it also includes the translation collection attribute translateMap. The query result after writing the translation result is as follows:
[0068] {translateMap:{ProvinceId:Henan Province}, ProvinceId:123}
[0069] Among them, translateMap:{ProvinceId:Henan Province} is the translateMap attribute of the Name value of the query result object written in. Compared with the common query result, the query result object includes both the ID value "123" and the translation result "Henan Province" according to the ID value, so that the translation result of the ID value is quickly obtained.
[0070] In some embodiments, the translation set attribute translateMap includes a key-value pair; step S140 of writing the translation result into the translation set attribute includes: writing the attribute name into the key of the translation set attribute, and writing the translation result into the value of the translation set attribute.
[0071] Continuing with the example above, translateMap:{ProvinceId:Henan Province} represents the key-value pair feature of translateMap, translateMap:{key:value}, where key is used to write the name of the attribute and value is used to write the translation result.
[0072] In some embodiments, before executing the processing class step, it also includes:
[0073] Step S121: grouping the query results according to the search object of the processing class, and grouping the query results of the processing classes with the same search object into one group. Meanwhile, the step of running the processing classes in step S130 includes: running the processing classes in different groups in parallel.
[0074] According to step S121, the search object of the processing class can be the regional library, dictionary library or third-party service mentioned above. The query results of the processing class with the same search object are grouped into one group. For example, multiple query results are obtained according to the query input, as follows:
[0075] {"ProvinceId":"123"}
[0076] {"CityId":"5"}
[0077] {"indicationCode":"001"}
[0078] {"indicationCode":"002"}
[0079] Wherein, indicationCode is a disease type code, for example, "001" indicates diabetes, "002" indicates hypertension, and the specific meaning of the disease type code is stored in, for example, a disease database. According to step S121, {"ProvinceId":"123"} and {"cityId":"5"} are grouped in one group, and the search objects of the two query results are both regional databases; {"indicationCode":"001"} and {"indicationCode":"002"} are grouped in the same group, and the search objects of the two query results are both disease databases.
[0080] Correspondingly, the annotations of {"ProvinceId":"123"} and {"cityId":"5"} each include an annotation, and the search objects of the processing class of the attribute ProvinceId and the processing class of the attribute cityId included in the annotation are both regional libraries; the annotations of {"indicationCode":"001"} and {"indicationCode":"002"} each include an annotation, and the search object of the processing class of the attribute indicationCode included in the annotation is the disease library.
[0081] In step S130, the processing classes in different groups are run in parallel, so that the translation results of the ID values in each group can be queried in batches, thereby improving the query performance.
[0082] In some embodiments, when multiple query results are obtained, before running the processing class step, it also includes: aggregating the ID values of the attributes with the same search object. For example, the above-mentioned ProvinceId, CountryID and CityID belong to the same type, and their search objects are all regional libraries, so the ID values corresponding to these attributes are aggregated together. According to these embodiments, multiple ID values are aggregated, and then the above-mentioned step S121 is executed to group the query results of these ID values. For ID values with the same search object, such as all ID values belonging to the regional library, queries are executed in parallel, which is equivalent to executing batch queries, further improving query performance.
[0083] In some embodiments, the method of the present invention further includes: storing the translation result in a cache. This is conducive to the reuse of the translation result. After steps S110-S140, the translation result is encapsulated in the translation set attribute. When the new query result includes the cached ID value, the translation result of the ID value can be directly obtained from the cache, further improving the query speed. Figure 2 FIG. 1 is an exemplary flow chart of a method for rapidly packaging ID value translation results according to another embodiment of the present invention. Figure 2 As shown, the method of this embodiment includes the following steps:
[0084] Step S201: Receive query input. This step is equivalent to Figure 1 The receiving query input in step S120 shown in FIG.
[0085] exist Figure 2 In the illustrated embodiment, the query interface has been defined to return an object including a target class, which includes a translation collection attribute translateMap. Specifically, the target class can be or inherit from the BaseDTO base class.
[0086] Step S202: Return the query result object. The above-mentioned section program can be used to run the steps after step S202 to intercept the query result object.
[0087] In step S203, it is determined whether the query result object is a list. If the result is yes, the first packaging process S210 is executed; if the result is no, the second packaging process S220 is executed.
[0088] This step is used to determine the number of query results. When only one query result is obtained, the query result object is a single object, and the query result object is directly processed in the second encapsulation process S220; when multiple query results are obtained, the multiple query result objects are given in the form of a list, and the list is processed in the first encapsulation process S210.
[0089] The first packaging process of step S210 includes the following steps:
[0090] Step S211: Expand the data, which means expanding the list to obtain multiple query result objects.
[0091] Step S212: Get the returned object member DTO. When the query result object belongs to or inherits from the BaseDTO base class, the query result object is used as the returned object, and its member DTO is obtained to obtain the data of the query result. In this step, the object member DTOs are obtained one by one according to the data in the list expanded in step S211.
[0092] Step S230: Parsing the DTO structure: In this step, each DTO structure in the list is parsed one by one.
[0093] For query result objects that need to be translated, annotations are used in advance to describe the processing class of related attributes. The processing class is used to find the translation result of the ID value corresponding to a certain attribute of the query result object. By parsing the DTO structure, the annotations and processing classes can be obtained.
[0094] Step S231: Determine whether there is an annotation in the DTO structure. If there is an annotation, execute step S213 in the first encapsulation process S210; if there is no annotation, execute step S232.
[0095] Step S232: Return the query result. If the previous step of this step is step S231, the query result does not include the translation result. If the previous step of this step is step S233, the query result includes the translation result. The query result here refers to the final result returned to the user, including the ID value and its translation result.
[0096] Step S213: Aggregate ID values. In this step, the ID values of the attributes of the same search object are aggregated together.
[0097] Step S214: Grouping. That is, grouping the query results according to the search objects of the processing classes as described above, and grouping the query results of the processing classes with the same search objects into one group.
[0098] Step S215: parallel search.
[0099] The parallel search includes two meanings. In step S213, ID values are aggregated according to the attribute type, and ID values of the same type can be searched in parallel. In step S214, multiple processing classes of different groups can be run synchronously according to the grouping result.
[0100] Step S216: Run the processing class.
[0101] Step S217: Batch query. By running these processing classes, batch query can be performed according to the list to obtain translation results of multiple ID values.
[0102] Step S233: writing the translation result into the translation set attribute translateMap. After this step, the query result returned in step S232 includes the translation set attribute translateMap filled with the translation result.
[0103] The second packaging process of step S220 includes the following steps:
[0104] Step S221: Get the returned object member DTO. This step is similar to step S212 in the first encapsulation process S210.
[0105] Step S230: Parse the returned object member DTO.
[0106] Step S231: Determine whether there is an annotation; if so, execute step S222; if not, execute step S232.
[0107] Step S222: Obtaining ID values. Although the query result to be processed in the second encapsulation process S220 is a single query result object, the query result object may include multiple attributes. For example, for the Shanghai First People's Hospital, in the query result, the ID value of the attribute of the hospital name is, for example, 101, the ID value of the attribute of the province is, for example, 201, and the ID value of the attribute of the level is, for example, 301. Therefore, multiple ID values can be obtained.
[0108] Step S223: Grouping. Continuing with the above example, multiple ID values can be divided into different groups according to attributes, for example, the ID value with the attribute of hospital name is group 1, the ID value with the attribute of province is group 1, and the ID value with the attribute of level is group 1.
[0109] Step S224: Parallel search. Continuing with the above example, since the translation results of the three ID values are stored in different databases, the translation results of the three ID values are searched in parallel in different databases in this step.
[0110] Step S225: Run the processing class.
[0111] Step S225: Single query.
[0112] Step S233: writing the translation result into the translation set attribute translateMap. After this step, the query result returned in step S232 includes the translation set attribute translateMap filled with the translation result.
[0113] It can be understood that after the query result is returned in step S232, the query result including the translation result is returned to the user. At this time, the interception program for obtaining the query result object can end the process.
[0114] Figure 2 The illustrated embodiment processes the query results separately according to the number of the query results, and adds the steps of expanding the data and aggregating the IDs in the first encapsulation process for the query results of the list, which can improve the query efficiency of the list data.
[0115] According to the method for rapidly encapsulating ID value translation results of the present invention, the translation results can be encapsulated in translation set attributes, thereby improving query efficiency and optimizing query performance.
[0116] The present invention also includes a device for rapidly encapsulating ID value translation results, comprising a memory and a processor, wherein the memory is used to store instructions executable by the processor; and the processor is used to execute the instructions to implement the method for rapidly encapsulating ID value translation results described above.
[0117] Figure 3 1 is a system block diagram of a device for rapidly encapsulating ID value translation results according to an embodiment of the present invention. Figure 3 As shown, the device 300 may include an internal communication bus 301, a processor 302, a read-only memory (ROM) 303, a random access memory (RAM) 304, and a communication port 305. When applied to a personal computer, the device 300 may also include a hard disk 306. The internal communication bus 301 can realize data communication between the components of the device 300. The processor 302 can make judgments and issue prompts. In some embodiments, the processor 302 can be composed of one or more processors. The communication port 305 can realize data communication between the device 300 and the outside. In some embodiments, the device 300 can send and receive information and data from the network through the communication port 305. The device 300 may also include different forms of program storage units and data storage units, such as a hard disk 306, a read-only memory (ROM) 303 and a random access memory (RAM) 304, which can store various data files used for computer processing and / or communication, and possible program instructions executed by the processor 302. The processor executes these instructions to implement the main part of the method. The processing result of the processor is transmitted to the user device through the communication port and displayed on the user interface.
[0118] The above-mentioned method for rapidly packaging ID value translation results can be implemented as a computer program, stored in the hard disk 306, and loaded into the processor 302 for execution to implement the method of the present application.
[0119] The present invention also includes a computer readable medium storing a computer program code, which implements the method described above when executed by a processor.
[0120] When the method for quickly encapsulating the ID value translation result is implemented as a computer program, it can also be stored in a computer-readable storage medium as a product. For example, a computer-readable storage medium may include, but is not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk, a magnetic strip), an optical disk (e.g., a compact disk (CD), a digital versatile disk (DVD)), a smart card, and a flash memory device (e.g., an electrically erasable programmable read-only memory (EPROM), a card, a stick, a key drive). In addition, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media (and / or storage media) that can store, contain and / or carry code and / or instructions and / or data.
[0121] It should be understood that the embodiments described above are only illustrative. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processor may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and / or other electronic units designed to perform the functions described herein, or a combination thereof.
[0122] Some aspects of the present application may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. In addition, various aspects of the present application may be represented as computer products located in one or more computer-readable media, which include computer-readable program codes. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes, etc.), optical disks (e.g., compact disks CDs, digital versatile disks DVDs, etc.), smart cards, and flash memory devices (e.g., cards, sticks, key drives, etc.).
[0123] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.
[0124] The basic concepts have been described above. Obviously, for those skilled in the art, the above invention disclosure is only used as an example and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and amendments to the present application. Such modifications, improvements and amendments are suggested in the present application, so such modifications, improvements and amendments still belong to the spirit and scope of the exemplary embodiments of the present application.
[0125] At the same time, the present application uses specific words to describe the embodiments of the present application. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present application can be appropriately combined.
[0126] In some embodiments, numbers are used to describe the quantity of components and attributes. It should be understood that such numbers used to describe the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of the present application are approximate values, in specific embodiments, such numerical values are set as accurately as possible within the feasible range.< / object>
Claims
1. A method for quickly encapsulating ID value translation results, include: The return object of the definition query interface includes a target class, and the target class includes a translation set attribute; receiving a query input through the query interface, obtaining a query result according to the query input, wherein the query result includes an ID value to be translated, the ID value corresponds to an attribute, and when a query result object corresponding to the query result belongs to the target class, obtaining an annotation from the query result object, the annotation including a processing class, and the processing class is used to find a translation result of the ID value corresponding to the attribute; Running the processing class to obtain the translation result; as well as Writing the translation result into the translation collection attribute of the query result object; Before the step of running the processing class, the method further includes: grouping the query results according to the search object of the processing class, and grouping the query results of the processing classes with the same search object into one group; the step of running the processing class includes: running the processing classes in different groups in parallel; When a plurality of query results are obtained, before executing the processing class step, the method further includes: aggregating the ID values of the attributes of the same search object.
2. The method according to claim 1, It is characterized in that The target class is a base class for data transfer objects.
3. The method according to claim 2, It is characterized in that The translation set attribute includes a key-value pair; the step of writing the translation result into the translation set attribute includes: writing the name of the attribute into the key of the translation set attribute, and writing the translation result into the value of the translation set attribute.
4. The method according to claim 1, It is characterized in that The search object includes a database or a third-party service.
5. The method according to claim 4, It is characterized in that The database includes a regional library or a dictionary library.
6. The method according to claim 1, It is characterized in that Also includes: The translation result is stored in a cache.
7. A device for quickly encapsulating the translation results of ID values, include: a memory for storing instructions executable by a processor; A processor, configured to execute the instructions to implement the method according to any one of claims 1 to 6.
8. A computer readable medium storing computer program code, wherein the computer program code, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Transcoding method and device and computer readable storage medium
CN110737436A