Data processing method and device, storage medium and electronic equipment

By using multiple service instances in a distributed system to provide data identification to name services, the problem of poor reliability of digital identification to name caused by centralized services is solved, and higher reliability and system stability are achieved.

CN119597826APending Publication Date: 2025-03-11YGSOFT INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411545684.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When displaying data to users, a centralized service is used to convert digital identification to name, and there is a problem of poor reliability in performing digital identification to name conversion.

Method used

By using multiple service instances in the distributed system to provide data identification to name services, when a user-triggered data display request is detected, the target digital identification and the identifier of the target data model are extracted from the request, the target service instance associated with the target data model is determined, and the name conversion process is performed through the service instance.

Benefits of technology

It realizes the dispersion of digital identification to name services to multiple service instances, avoiding single point of failure and improving the reliability of performing digital identification to name.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597826A_ABST
    Figure CN119597826A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a storage medium and electronic equipment. Relates to the field of distributed systems, and the method comprises the steps that under the condition that a data display request triggered by a user is detected, a target digital identifier of to-be-displayed data and a target identifier of a target data model are extracted from the data display request, and the target data model is a data model to which the to-be-displayed data belongs; based on the target identifier, a target service instance associated with the target data model is determined from multiple service instances, and different service instances are used for providing data identifier-to-name services for data of different data models; and performing name conversion processing on the target digital identifier through the target service instance to obtain a target name of the to-be-displayed data. According to the method and the device, the technical problem of poor reliability of digital identifier-to-name conversion due to the fact that digital identifier-to-name conversion is carried out by adopting centralized service when data is displayed to a user in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed systems, and in particular to a data processing method, device, storage medium and electronic device. Background Art

[0002] In modern information technology systems, data display and processing are crucial links. Among them, converting digital identifiers (i.e., IDs) in the database into user-readable names is a common requirement. At present, in the related art, when displaying data to users, centralized services are used to convert digital identifiers to names. Centralized services may become a single point of failure in the system, resulting in poor reliability in executing digital identifier-to-name conversion.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a data processing method, device, storage medium and electronic device to at least solve the technical problem in the related art that when displaying data to a user, a centralized service is used to convert a digital identifier into a name, and there is poor reliability in executing the conversion of the digital identifier into a name.

[0005] According to one aspect of an embodiment of the present invention, a data processing method is provided, comprising: in the case of detecting a data display request triggered by a user, extracting a target digital identifier of the data to be displayed and a target identifier of a target data model from the data display request, wherein the target data model is a data model to which the data to be displayed belongs; based on the target identifier, determining a target service instance associated with the target data model from a plurality of service instances, wherein different service instances are used to provide data identifier-to-name services for data of different data models; and performing name conversion processing on the target digital identifier through the target service instance to obtain a target name of the data to be displayed.

[0006] Furthermore, the data processing method also includes: obtaining a mapping relationship between multiple service instances and multiple data models; and determining a target service instance from the multiple service instances based on a target identifier and the mapping relationship.

[0007] Furthermore, the data processing method also includes: for each service instance, during the startup process of the service instance, parsing the model configuration information associated with the service instance through the service instance to obtain a metadata model corresponding to the data model associated with the service instance, wherein the metadata model at least includes an identifier of the data model associated with the service instance; and establishing a mapping relationship between the service instance and the data model associated with the service instance in the target storage area based on the metadata model and the service information of the service instance through the service instance to obtain a mapping relationship between multiple service instances and multiple data models.

[0008] Furthermore, the data processing method also includes: after performing name conversion processing on the target digital identifier through the target service instance to obtain the target name of the data to be displayed, if the data type of the data to be displayed is an enumeration type, caching the target name of the data to be displayed locally.

[0009] Furthermore, the data processing method also includes: before extracting the target digital identifier of the data to be displayed and the target identifier of the target data model from the data display request, in response to the user's interactive operation on the target control in the front-end interactive interface, determining the digital identifier of the data associated with the target control to obtain the target digital identifier, wherein the target control is at least used to display data; determining the identifier of the data model to which the data associated with the target control belongs to obtain the target identifier; and generating a data display request based on the target digital identifier and the target identifier.

[0010] Furthermore, the data processing method also includes: determining the data type of the data associated with the target control; when the data type is an enumeration type, determining the enumeration definition referenced by the target control, and determining the enumeration value in the enumeration definition as the target digital identifier; when the data type is an entity type, determining the target attribute in the entity model referenced by the target control, and determining the attribute value of the target attribute as the target digital identifier.

[0011] Furthermore, the data processing method also includes: when the target service instance is a local service, calling the target service instance based on a function call or a method call to perform name conversion processing on the target digital identifier to obtain the target name; when the target service instance is a remote service, calling the target service instance based on a remote procedure call to perform name conversion processing on the target digital identifier to obtain the target name.

[0012] According to another aspect of an embodiment of the present invention, a data processing device is also provided, including: an extraction module, used to extract the target digital identifier of the data to be displayed and the target identifier of the target data model from the data display request when a data display request triggered by a user is detected, wherein the target data model is the data model to which the data to be displayed belongs; a first determination module, used to determine the target service instance associated with the target data model from multiple service instances based on the target identifier, wherein different service instances are used to provide data identifier-to-name services for data of different data models; a processing module, used to perform name conversion processing on the target digital identifier through the target service instance to obtain the target name of the data to be displayed.

[0013] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data processing method when running.

[0014] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a memory for storing one or more programs, so that when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the above-mentioned data processing method when running.

[0015] In an embodiment of the present invention, a data identifier conversion service is provided based on multiple service instances in a distributed system. When a data display request triggered by a user is detected, the target digital identifier of the data to be displayed and the target identifier of the target data model are extracted from the data display request. Then, based on the target identifier, a target service instance associated with the target data model is determined from multiple service instances, so that the target digital identifier is converted to a name through the target service instance to obtain the target name of the data to be displayed. The target data model is the data model to which the data to be displayed belongs, and different service instances are used to provide data identifier conversion services for data of different data models.

[0016] In the above process, by setting different service instances for providing data identifier-to-name services for data of different data models, the service of converting digital identifiers to names is dispersed to multiple service instances, avoiding the occurrence of single point failures, thereby effectively improving the reliability of executing digital identifier-to-name conversion. Furthermore, by determining the target service instance associated with the target data model from multiple service instances based on the target identifier of the data model to which the data to be displayed belongs, the service instance for processing the data to be displayed is accurately determined, and the target name of the data to be displayed is obtained by performing name conversion processing on the target digital identifier based on the target service instance, thereby realizing the service of converting digital identifiers to names for the data to be displayed based on the service instance corresponding to the data to be displayed, thereby further improving the reliability of executing digital identifier-to-name conversion.

[0017] It can be seen that the solution provided by the present application achieves the purpose of providing data identifier-to-name services based on multiple service instances in a distributed system, thereby achieving the technical effect of improving the reliability of executing digital identifier-to-name conversion, and further solving the technical problem in the related technology of using centralized services to convert digital identifiers to names when displaying data to users, resulting in poor reliability in executing digital identifier-to-name conversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0019] Figure 1 is a schematic diagram of an optional data processing method according to an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram of the relationship between an optional metadata model, a data model, and a display model according to an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of an architecture of an optional application in a distributed system according to an embodiment of the present invention;

[0022] Figure 4 is a schematic diagram of an optional method for establishing a mapping relationship according to an embodiment of the present invention;

[0023] Figure 5 is a schematic diagram of an optional entity editing page according to an embodiment of the present invention Figure 1 ;

[0024] Figure 6 is a schematic diagram of an optional entity editing page according to an embodiment of the present invention Figure 2 ;

[0025] Figure 7 is a schematic diagram of an optional type ID and name according to an embodiment of the present invention;

[0026] Figure 8 is a flow chart of an optional data processing method according to an embodiment of the present invention;

[0027] Fig. 9 is a schematic diagram of an optional data processing device according to an embodiment of the present invention;

[0028] Fig.10 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0032] Example 1

[0033] According to an embodiment of the present invention, an embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] Figure 1 is a schematic diagram of an optional data processing method according to an embodiment of the present invention, such as Figure 1 As shown, the method is applied to a distributed system and includes the following steps:

[0035] Step S101 , when a data display request triggered by a user is detected, a target digital identifier of the data to be displayed and a target identifier of a target data model are extracted from the data display request, wherein the target data model is a data model to which the data to be displayed belongs.

[0036] Optionally, a digital identifier can also be called an ID. An ID is used to uniquely identify a record or object in a database or system. A name is more user-friendly than an ID and is easier for users to identify and remember. Therefore, when displaying data to users, the above ID needs to be converted into a name to display to the user.

[0037] Optionally, the distributed system may include modules such as model ID name modeling configuration, display model, front-end ID name framework, and back-end ID name framework.

[0038] The front end of the target application in the distributed system (i.e., the aforementioned front end ID name framework) can generate a data display request when detecting the user's interactive operation on the target control in the front end interactive interface to trigger the data display request, and then send the data display request to the back end of the target application in the distributed system (i.e., the aforementioned back end ID name framework). When the back end receives the data display request, it can extract the target digital identification of the data to be displayed and the target identifier of the target data model from the data display request. Among them, the aforementioned target application can be any application in the distributed system.

[0039] Optionally, the data to be displayed is data in an entity. The data model is an abstraction and description of the entity, which is used to define the structure and operation of the data. The metadata model is a specification and structure that describes the data model.

[0040] Step S102: based on the target identifier, determine a target service instance associated with the target data model from a plurality of service instances, wherein different service instances are used to provide data identifier-to-name conversion services for data of different data models.

[0041] Optionally, the above-mentioned backend can determine the target service instance associated with the target data model from multiple service instances based on the mapping relationship between the service instance and the data model and based on the target identifier. In an optional embodiment, the front end of the target application preferentially calls the back end of the target application by default, and the back end of each application includes at least one service instance, and the aforementioned multiple service instances can belong to the same application or different applications.

[0042] In some embodiments, the backend of each application relies on an ID name component. Specifically, each service instance in the backend includes an ID name component, and the service instance provides a data identifier-to-name service through the ID name component. Optionally, the service in each application can be understood as an ID name service.

[0043] Optionally, different service instances are used to provide data identifier-to-name services for data in different data models. For example, different data models are defined in different service instances, and the service instances are used to provide data identifier-to-name services for data based on the data models.

[0044] Optionally, the backend can implement functions such as obtaining the name of entity type data, obtaining the name of enumeration type data, obtaining the name of business classification type data, etc. through the service instance. For the name conversion of Boolean type data, it does not need to be implemented in the backend and can be preset in the front-end framework.

[0045] In some embodiments, the backend may also provide name expansion based on common entities, may dynamically specify name fields programmatically, or may programmatically return name content according to business logic.

[0046] It should be noted that when business logic is tightly coupled with name management, the code becomes difficult to understand and maintain, which increases the difficulty of subsequent development and debugging, and this coupling limits the system's ability to adapt to changes. If you need to change the name conversion rules or introduce new data entities, large-scale code reconstruction may be required. In this application, by performing ID-to-name processing based on the above-mentioned ID name component, the coupling between business logic and naming management is reduced, thereby reducing the dependency between various parts of the system, making the system easier to expand and maintain, and reducing development costs and risks.

[0047] Step S103, performing name conversion processing on the target digital identifier through the target service instance to obtain the target name of the data to be displayed.

[0048] The essence of software development is to reduce the complexity of software, so a reusable software architecture is needed, and the general entity framework is a reusable architecture system. The general entity framework provides three models, namely metadata model, data model and display model. Figure 2 is a schematic diagram of the relationship between an optional metadata model, a data model, and a display model according to an embodiment of the present invention, such as Figure 2 As shown, the metadata model is a model of data attribute characteristics, the metadata model describes the specifications and structure of the data model, the data model is a model for processing data operations, the data model is the implementation of the metadata model, the display model is a model that assists in converting the data model ID value to a name, and the data model supports the display model.

[0049] Optionally, the display model contains information such as data type, category ID, type ID, data ID, data name and data auxiliary name, and provides an interface for obtaining the name based on the metadata of the field. The display model can be used to record the correspondence between each ID (including but not limited to the aforementioned category ID, type ID, data ID) and the name. The display model can be used to uniformly and quickly access the name corresponding to the ID value in the data model. The display model can be loaded on the front end and the back end.

[0050] Optionally, the target service instance can determine the name corresponding to the target digital identifier from the corresponding relationship recorded in the display model through the aforementioned ID name component, thereby obtaining the target name. For example, the ID name component can directly search for a name that matches the target digital identifier in the corresponding relationship, and determine the name as the target name. For another example, the ID name component can find the corresponding relationship corresponding to the metadata model in the corresponding relationship based on the metadata model of the data model to which the target digital identifier belongs, thereby searching for a name that matches the target digital identifier in the corresponding relationship corresponding to the metadata model, and determine the name as the target name.

[0051] After obtaining the target name, the backend can feed back the target name corresponding to the data to be displayed to the frontend, and then the frontend will display the target name of the data to be displayed in the front-end interactive interface (such as, displaying it in a page or table column) to display the target name to the user.

[0052] In some embodiments, the front end supports ID name conversion of data in various types of controls (such as general entity selection, enumeration, business classification, Boolean, etc.), as well as name conversion of controls on table views; the front end control names are bidirectionally bound, and are automatically refreshed and displayed to the corresponding position of the interface through automatic name loading. When the front end page is initialized and opened, there is no need for each control in the front end to initiate an ID name conversion request (that is, a data display request). Instead, the front end unifies the framework, collects the data that needs to be converted, uniformly calls the ID name conversion (that is, implemented through a data display request), and then renders the interface, thereby reducing the number of requests sent and improving page loading performance. Optionally, the front end can also cache ID names, and the loaded names do not need to be requested to be loaded again, and the name data can be obtained from the local cache of the front end.

[0053] In some embodiments, Figure 3 is a schematic diagram of an architecture of an optional distributed system application according to an embodiment of the present invention, such as Figure 3 As shown, the overall architecture of the application includes the front-end framework layer (i.e. Figure 3 The application layer in the above mentioned front-end ID name framework) and the back-end framework layer (i.e. Figure 3The framework layer in the backend ID name framework, that is, the backend ID name framework mentioned above) and the support layer; the front-end ID name framework includes but is not limited to front-end cache, two-way binding of names, priority mechanism (such as setting user operation or instruction priority), front-end extension (such as extension control, etc.) and control name display (including but not limited to entity type, enumeration type, table type and other data name display) and other functions; the back-end ID name framework includes but is not limited to extension mechanism, cache mechanism, update mechanism (such as updating service instance, etc.), entity registration, entity name lookup, enumeration name lookup, preloading and service distribution (i.e. determining the target service instance) and other functions. The support layer can also be called the infrastructure layer, which refers to the hardware and software environment that supports the operation of the entire application. The support layer includes the microservice base and standard services. In a distributed system, by using the aforementioned framework, name rule changes or name updates can be uniformly processed and updated by the framework, thereby achieving the effect of name consistency. In addition, as the scale of the system expands, centralized services may become performance bottlenecks, especially in high-concurrency scenarios, request processing delays will increase significantly. Therefore, by implementing the above steps based on a distributed system, business performance requirements can be effectively met.

[0054] Based on the scheme defined in the above steps S101 to S103, it can be known that in an embodiment of the present invention, a method of providing a data identifier-to-name service based on multiple service instances in a distributed system is adopted. When a data display request triggered by a user is detected, the target digital identifier of the data to be displayed and the target identifier of the target data model are extracted from the data display request, and then based on the target identifier, the target service instance associated with the target data model is determined from multiple service instances, so that the target digital identifier is name-converted through the target service instance to obtain the target name of the data to be displayed. The target data model is the data model to which the data to be displayed belongs, and different service instances are used to provide data identifier-to-name services for data of different data models.

[0055] It is easy to notice that in the above process, by setting different service instances for providing data identifier-to-name services for data of different data models, it is possible to disperse the digital identifier-to-name services to multiple service instances, thus avoiding the occurrence of single point failures, thereby effectively improving the reliability of executing digital identifier-to-name conversion. Furthermore, by determining the target service instance associated with the target data model from multiple service instances based on the target identifier of the data model to which the data to be displayed belongs, it is possible to accurately determine the service instance used to process the data to be displayed, and by performing name conversion processing on the target digital identifier based on the target service instance, the target name of the data to be displayed is obtained, thereby achieving the digital identifier-to-name service for the data to be displayed based on the service instance corresponding to the data to be displayed, thereby further improving the reliability of executing digital identifier-to-name conversion.

[0056] It can be seen that the solution provided by the present application achieves the purpose of providing data identifier-to-name services based on multiple service instances in a distributed system, thereby achieving the technical effect of improving the reliability of executing digital identifier-to-name conversion, and further solving the technical problem in the related technology of using centralized services to convert digital identifiers to names when displaying data to users, resulting in poor reliability in executing digital identifier-to-name conversion.

[0057] In an optional embodiment, in the process of determining a target service instance associated with a target data model from multiple service instances based on a target identifier, the distributed system can obtain a mapping relationship between multiple service instances and multiple data models, thereby determining the target service instance from multiple service instances based on the target identifier and the mapping relationship.

[0058] Optionally, the mapping relationship between the multiple service instances and the multiple data models may be stored in a target storage area, and the target storage area may be a database, a cloud server, an electronic device, etc. In some embodiments, the target storage area may be a Redis cache system.

[0059] Optionally, the mapping relationship between multiple service instances and multiple data models can be established based on the identifier of the data model and the service information of the service instance. Therefore, the backend in the distributed system can obtain the mapping relationship between multiple service instances and multiple data models from the target storage area, and then find the service information matching the target identifier from the mapping relationship, so as to determine the service instance to which the service information belongs as the target service instance.

[0060] Optionally, the above service information may be an identifier of a service instance, an IP address of a service instance, etc.

[0061] It should be noted that, through the above process, it is possible to determine the target service instance based on the preset mapping relationship, thereby improving the accuracy of determining the target service instance.

[0062] In an optional embodiment, in the process of obtaining the mapping relationship between multiple service instances and multiple data models, the distributed system can, for each service instance, parse the model configuration information associated with the service instance through the service instance during the startup of the service instance, obtain the metadata model corresponding to the data model associated with the service instance, and then establish the mapping relationship between the service instance and the data model associated with the service instance in the target storage area based on the metadata model and the service information of the service instance, so as to obtain the mapping relationship between the multiple service instances and the multiple data models. The metadata model at least includes the identifier of the data model associated with the service instance.

[0063] Optional, Figure 4 is a schematic diagram of an optional mapping relationship according to an embodiment of the present invention. Figure 4 As shown, when the service instance is started, the initialization phase triggers automatic scanning of the model configuration information. This process automatically detects all models defined in the service instance and their associated annotations through reflection mechanism or metadata parsing to ensure the integrity and accuracy of the model information. Optionally, the aforementioned model configuration information is pre-configured in the service instance by the developer, and the model configuration information associated with the service instance is the model configuration information in the service instance, and the model configuration information includes at least the data model and the metadata model of the data model.

[0064] Optionally, the annotation parser is responsible for identifying specific annotations on the data model in the model configuration information. These annotations carry key information such as data model attributes. The parsed information will be encapsulated into a structured metadata model to provide a basis for subsequent registration and communication. It should be noted that after the service instance parses the model configuration information, it can also obtain the data model.

[0065] Optionally, after parsing and obtaining the metadata model corresponding to the data model, the service instance can establish a mapping relationship between the service instance and the data model associated with the service instance in the target storage area based on the metadata model and the service information of the service instance. For example, the corresponding relationship between the metadata model and the service information is registered in a unified, distributed cache system (such as Redis), and the corresponding relationship between the metadata model and the service information represents the mapping relationship between the data model and the service instance.

[0066] Optionally, after parsing and obtaining the metadata model corresponding to the data model, the service instance may also extract summary information from the metadata model to obtain summary metadata, wherein the summary metadata at least includes an identifier of the data model associated with the service instance. Then, based on the metadata model and the service information of the service instance, a mapping relationship between the service instance and the data model associated with the service instance is established in the target storage area. For example, Figure 4 As shown, the correspondence between the summary metadata and the service information is registered in a unified, distributed cache system (such as Redis). The correspondence between the summary metadata and the service information represents the mapping relationship between the data model and the service instance.

[0067] Through the above method, the mapping relationship between the service instance and the data model associated with the service instance is effectively established, and the global visibility and consistency of the model information are ensured. All service instances can obtain the latest model information from the same cache, avoiding information islands and synchronization delays.

[0068] In an optional embodiment, after the target digital identifier is name converted by the target service instance to obtain the target name of the data to be displayed, the target processing system can cache the target name of the data to be displayed locally if the data type of the data to be displayed is an enumeration type.

[0069] Optionally, the data type of the data to be displayed may be an entity type, an enumeration type, a business classification type, a Boolean type, etc.

[0070] Optionally, when the data type of the data to be displayed is an enumeration type, after the backend of the distributed system determines the target name, the backend can cache the target name of the data to be displayed locally, so that the next time when the data display request corresponding to the same data to be displayed is detected, the digital identifier is no longer converted to a name through the target service instance, but the target name of the data to be displayed is directly obtained from the local cache and sent to the front end. In some embodiments, the aforementioned local refers to the server where the backend of the target application in the distributed system is located.

[0071] In some embodiments, after the backend extracts the target digital identifier of the data to be displayed and the target identifier of the target data model from the data display request, the name search order of the backend can be local cache acquisition, Redis cache acquisition (acquiring the aforementioned mapping relationship), and performing a local service call or a remote service call according to the mapping relationship. For example, in the case where the data type of the data to be displayed is an enumeration type, first determine whether the target name of the data to be displayed exists in the local cache. If not, perform Redis cache acquisition, perform a local service call or a remote service call according to the mapping relationship, and cache the obtained target name locally after the call for the next acquisition from the local cache; if the target name of the data to be displayed exists in the local cache, the target name is directly fed back to the front end without performing the subsequent Redis cache acquisition and local service call or remote service call steps according to the mapping relationship.

[0072] In some embodiments, when the ID or name is partially refreshed, the ID name corresponding to the local and shared Redis identifiers can expire. The next time the ID name correspondence is obtained, it will be determined whether the correspondence in the cache is expired. If it is expired, the ID name is retrieved again. Due to the multi-node service instance, there are performance and instability issues in clearing the cache. Therefore, it is not handled here by clearing the cache, but by identifying expiration. Each service instance has built-in automatic judgment and expiration checking capabilities and reloading capabilities to ensure stability and relative performance.

[0073] It should be noted that, through the above process, the distributed system does not need to call the service instance again when obtaining the name of the same data to be displayed next time, thereby improving data processing efficiency.

[0074] In an optional embodiment, before extracting the target digital identifier of the data to be displayed and the target identifier of the target data model from the data display request, the distributed system can respond to the user's interactive operation on the target control in the front-end interactive interface, determine the digital identifier of the data associated with the target control, obtain the target digital identifier, and then determine the identifier of the data model to which the data associated with the target control belongs, obtain the target identifier, and thus generate a data display request based on the target digital identifier and the target identifier. The target control is at least used to display data.

[0075] Optionally, the front end is provided with a plurality of controls in the front end interactive interface, and the target control may be a control among the plurality of controls for the user to select data in the entity to be edited (such as: created, modified, etc.), and the target control is displayed in the entity editing page. For example, the target control may be a drop-down box, and when the user edits the entity through the front end, the user clicks (i.e., interacts with) the drop-down box, and the drop-down box pops up and displays a plurality of data for the user to select, and then the data selected by the user in the drop-down box is determined as the data to be saved in the entity to be created. Among them, the data to be displayed in the drop-down box for the user to select can be understood as the above-mentioned data to be displayed.

[0076] Therefore, the front end of the target application in the distributed system can respond to the user's interactive operation on the target control in the front-end interactive interface (such as clicking, mouse rolling, etc.), determine the digital identifier of the data associated with the target control, and obtain the target digital identifier, wherein the target control is at least used to display data, and the aforementioned interactive operation refers to the operation used to instruct the target control to display data, and the data associated with the target control is the data that needs to be displayed in the target control for the user to select, that is, the above-mentioned data to be displayed.

[0077] Optionally, the front end may obtain the digital identifier of the data associated with the target control, thereby determining the data identifier as the target digital identifier, wherein the digital identifier of the data associated with the target control is preset in the front end, and the association relationship between the target control and the data is also preset in the front end.

[0078] Optionally, the identifiers of each data model are preset in the front end. Optionally, the target control is displayed in the entity editing page, and the front end can determine the data model of the entity corresponding to the entity editing page where the target control is located as the data model to which the data associated with the target control belongs, thereby determining the identifier corresponding to the data model as the target identifier.

[0079] After determining the target digital identification and the target identifier, the front end may generate a data display request based on the target digital identification and the target identifier.

[0080] It should be noted that, through the above process, accurate generation of data display requests is achieved, thereby improving the accuracy of the target name determined subsequently, that is, improving the reliability of executing digital identification to name conversion.

[0081] In an optional embodiment, in the process of determining the digital identifier of the data associated with the target control and obtaining the target digital identifier, the distributed system can determine the data type of the data associated with the target control, and when the data type is an enumeration type, determine the enumeration definition referenced by the target control, and determine the enumeration value in the enumeration definition as the target digital identifier; when the data type is an entity type, determine the target attribute in the entity model referenced by the target control, and determine the attribute value of the target attribute as the target digital identifier.

[0082] Optionally, the data type of the data to be displayed (that is, the data associated with the target control) can be an entity type, an enumeration type, a business classification type, a Boolean type, etc. That is, the entity to be edited can reference another entity, or can reference enumeration data, business classification data, Boolean data, etc.

[0083] Optionally, when the data type is an enumeration type, the front end can determine the enumeration definition referenced by the target control, and determine the enumeration value in the enumeration definition as the target digital identifier. The correspondence between the target control and the enumeration definition is preset in the front end, and the enumeration definition includes the enumeration value, which is a digital identifier. For example, if the target control is a gender selection control, the enumeration definition referenced by the target control is used to define the IDs corresponding to male and female, respectively. For another example, if the target control is an occupation selection control, the enumeration definition referenced by the target control is used to define the IDs corresponding to different occupations. For example, Figure 5 is a schematic diagram of an optional entity editing page according to an embodiment of the present invention Figure 1 , Figure 5 The page shown in is the entity editing page. Figure 5 Includes multiple attributes of the entity to be filled in with attribute values ​​(such as: Figure 5 name, number, gender, age, etc.), Figure 5 The drop-down box at the gender in the target control is the target control, and what is displayed in the target control is the name corresponding to the enumeration value in the enumeration definition referenced by the target control.

[0084] Optionally, before providing the user with the function of editing entities, developers need to perform entity modeling, that is, build a data model corresponding to the entity to support users in editing entities.

[0085] In some embodiments, the ID name modeling configuration in the distributed system is used to provide related functions in the entity modeling process. For example, the ID name modeling configuration supports the entity model to open the ID name field, and also supports the custom ID name field, and the addition of auxiliary name field functions; it also supports the enumeration name definition function; in entity modeling, you can add fields with data types of entity types and enumerations, and then select the specific entities and enumerations to reference. When the page is displayed, the entity type and enumeration fields will automatically obtain the name of the referenced entity or enumeration through the ID name framework, and display it on the page or table column. In this embodiment, entity and entity model have the same meaning.

[0086] Optionally, the ID name modeling configuration includes the enumeration ID name modeling configuration, which supports the enumeration name definition, that is, the developer can add a field (that is, attribute) with an enumeration data type in the entity modeling process through the enumeration ID name modeling configuration, and then select the specific enumeration definition to reference, so as to obtain the enumeration definition used in the entity, and the developer can configure the correspondence between the enumeration definition and the control, so as to store the correspondence in the aforementioned model configuration information and the front end. When it comes to running the page display, the name of the referenced enumeration can be automatically obtained through the ID name framework, so as to be displayed in the page or table column.

[0087] Optionally, when the data type is an entity type, the front end can determine the target attribute in the entity model referenced by the target control, and determine the attribute value of the target attribute as the target digital identifier. The entity model includes multiple attributes, and the target attribute is one of the multiple attributes of the entity model. The target attribute can be pre-selected by the developer. For example, if the entity model is a computer, the attributes of the entity model include product name (such as: computer), product number, rule model, unit price, quantity, etc., and the target attribute can be the product name. For example, Figure 6 is a schematic diagram of an optional entity editing page according to an embodiment of the present invention Figure 2 , Figure 6 The page shown in is the entity editing page. Figure 6 Includes multiple attributes of the entity to be filled in with attribute values ​​(such as: Figure 5 purchased goods, consignee, order time, order status, etc.), Figure 6 The drop-down box at the purchase item in the target control is the target control. The target control displays the name of the target attribute in the entity model referenced by the target control. The target attribute is the product name (such as Figure 6 computer, mouse, etc.), so that users can quickly select products.

[0088] Optionally, the ID name modeling configuration includes the entity ID name modeling configuration, which supports the entity model to enable the ID name field, supports custom ID name fields, and adds auxiliary name fields. Developers can use the ID name modeling configuration to add fields (that is, attributes) with the data type of the entity type during the entity modeling process, and then select the specific entity model to reference. When the page is displayed, the ID name framework can be used to automatically obtain at least the name of the target field (that is, the target attribute) of the referenced entity and display it on the page or table column.

[0089] In an optional embodiment, the display model includes information such as data type, category ID, type ID, data ID, data name and data auxiliary name, and provides an interface for obtaining the name based on the metadata of the field. The display model can be used to record the correspondence between each ID (including but not limited to the aforementioned category ID, type ID, data ID) and the name. The display model can be used to uniformly and quickly access the name corresponding to the ID value in the data model. The display model can be loaded on the front end and the back end. For example, Figure 7 is a schematic diagram of an optional type ID and name according to an embodiment of the present invention, such as Figure 7 As shown, Figure 7 The content under "Classification Code" is the type ID corresponding to each category in the business classification. Figure 7 The content under "Category Name" is the name corresponding to each category ID. Figure 7 The categories in the business classification shown in can be used as attribute values ​​of attributes in certain entities (such as business application forms).

[0090] It should be noted that, through the above process, the target digital identifier is accurately determined, thereby effectively improving the accuracy of the converted target name.

[0091] In an optional embodiment, in the process of performing name conversion processing on the target digital identifier through the target service instance to obtain the target name of the data to be displayed, the distributed system can, when the target service instance is a local service, call the target service instance based on a function call or a method call to perform name conversion processing on the target digital identifier to obtain the target name; when the target service instance is a remote service, call the target service instance based on a remote procedure call to perform name conversion processing on the target digital identifier to obtain the target name.

[0092] Optionally, the backend of the target application in the distributed system can determine whether the target service instance is a local service based on the service information of the target service instance. For example, if the IP address of the target service instance is the same as the IP address of the target application, the target service instance is determined to be a local service, otherwise, the target service instance is determined to be a remote service.

[0093] Optionally, if the target service is located inside the target application, the backend of the target application can directly call the local service interface to perform ID-to-name processing to obtain the target name. Local calls avoid network delays and provide faster response speeds and higher execution efficiency. If the target service is located in a remote application, an ID-to-name calculation request is sent to the remote service through a remote procedure call (RPC) or other distributed call protocol to call the target service instance to perform name conversion processing on the target digital identifier to obtain the target name.

[0094] For example, Figure 8 is a flow chart of an optional data processing method according to an embodiment of the present invention. Figure 8 As shown, when the backend detects a data display request, it first extracts the target digital identifier of the data to be displayed and the target identifier of the target data model from the data display request, and then determines the corresponding service instance from Redis based on the target identifier to obtain the target service instance. After that, it determines whether the target service instance is a local service. If so, it directly calls the local service interface and performs ID conversion to name locally. If it is not a local service, it sends an ID name calculation request to the remote service to obtain the target name from the remote.

[0095] It should be noted that, through the above process, accurate calling of the target service instance is achieved, thereby further improving the reliability of executing the digital identity conversion to a name.

[0096] It can be seen that the solution provided by the present application achieves the purpose of providing data identifier-to-name services based on multiple service instances in a distributed system, thereby achieving the technical effect of improving the reliability of executing digital identifier-to-name conversion, and further solving the technical problem in the related technology of using centralized services to convert digital identifiers to names when displaying data to users, which results in poor reliability in executing digital identifier-to-name conversion.

[0097] Example 2

[0098] According to an embodiment of the present invention, an embodiment of a data processing device is provided, wherein: Fig. 9 is a schematic diagram of an optional data processing device according to an embodiment of the present invention. Fig. 9 As shown, the device comprises:

[0099] An extraction module 901 is used to extract a target digital identifier of the data to be displayed and a target identifier of a target data model from the data display request when a data display request triggered by a user is detected, wherein the target data model is a data model to which the data to be displayed belongs;

[0100] A first determination module 902 is used to determine a target service instance associated with a target data model from a plurality of service instances based on a target identifier, wherein different service instances are used to provide a data identifier-to-name service for data of different data models;

[0101] The processing module 903 is used to perform name conversion processing on the target digital identifier through the target service instance to obtain the target name of the data to be displayed.

[0102] It should be noted that the above-mentioned extraction module 901, first determination module 902 and processing module 903 correspond to steps S101 to S103 in the above-mentioned embodiment. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0103] Optionally, the first determination module further includes: an acquisition submodule, used to acquire a mapping relationship between multiple service instances and multiple data models; and a first determination submodule, used to determine a target service instance from the multiple service instances based on the target identifier and the mapping relationship.

[0104] Optionally, the acquisition submodule also includes: a parsing unit, used for, for each service instance, during the startup process of the service instance, parsing the model configuration information associated with the service instance through the service instance to obtain a metadata model corresponding to the data model associated with the service instance, wherein the metadata model at least includes an identifier of the data model associated with the service instance; a processing unit, used for establishing a mapping relationship between the service instance and the data model associated with the service instance in the target storage area based on the metadata model and the service information of the service instance through the service instance, so as to obtain a mapping relationship between multiple service instances and multiple data models.

[0105] Optionally, the data processing device further includes: a cache processing module, configured to cache the target name of the data to be displayed locally when the data type of the data to be displayed is an enumeration type.

[0106] Optionally, the data processing device also includes: a second determination module, used to determine the digital identifier of the data associated with the target control in response to the user's interactive operation on the target control in the front-end interactive interface, and obtain the target digital identifier, wherein the target control is at least used to display data; a third determination module, used to determine the identifier of the data model to which the data associated with the target control belongs, and obtain the target identifier; and a generation module, used to generate a data display request based on the target digital identifier and the target identifier.

[0107] Optionally, the third determination module also includes: a second determination submodule, used to determine the data type of the data associated with the target control; a third determination submodule, used to determine the enumeration definition referenced by the target control when the data type is an enumeration type, and determine the enumeration value in the enumeration definition as the target digital identifier; a fourth determination submodule, used to determine the target attribute in the entity model referenced by the target control when the data type is an entity type, and determine the attribute value of the target attribute as the target digital identifier.

[0108] Optionally, the processing module also includes: a first processing sub-module, which is used to call the target service instance based on a function call or a method call to perform name conversion processing on the target digital identifier to obtain a target name when the target service instance is a local service; and a second processing sub-module, which is used to call the target service instance based on a remote procedure call to perform name conversion processing on the target digital identifier to obtain a target name when the target service instance is a remote service.

[0109] Example 3

[0110] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data processing method when running.

[0111] Example 4

[0112] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, wherein: Fig.10 is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as Fig.10 As shown, the electronic device includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned data processing method when running.

[0113] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0114] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0117] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0119] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data processing method, characterized in that: Applied to distributed systems, including: In the case of detecting a data display request triggered by a user, extracting a target digital identifier of the data to be displayed and a target identifier of a target data model from the data display request, wherein the target data model is a data model to which the data to be displayed belongs; Based on the target identifier, determining a target service instance associated with the target data model from a plurality of service instances, wherein different service instances are used to provide data identifier-to-name conversion services for data of different data models; The target digital identifier is name-converted by the target service instance to obtain the target name of the data to be displayed.

2. The method according to claim 1, characterized in that: Determining a target service instance associated with the target data model from a plurality of service instances based on the target identifier includes: Get the mapping relationship between multiple service instances and multiple data models; The target service instance is determined from the multiple service instances based on the target identifier and the mapping relationship.

3. The method according to claim 2, characterized in that Get the mapping relationship between multiple service instances and multiple data models, including: For each service instance, during the startup process of the service instance, the model configuration information associated with the service instance is parsed by the service instance to obtain a metadata model corresponding to the data model associated with the service instance, wherein the metadata model at least includes an identifier of the data model associated with the service instance; Based on the metadata model and the service information of the service instance, a mapping relationship between the service instance and the data model associated with the service instance is established in the target storage area by the service instance to obtain mapping relationships between multiple service instances and multiple data models.

4. The method according to claim 1, characterized in that After the target digital identifier is converted by the target service instance to obtain the target name of the data to be displayed, the method further includes: In the case that the data type of the data to be displayed is an enumeration type, the target name of the data to be displayed is cached locally.

5. The method according to claim 1, characterized in that Before extracting the target digital identification of the data to be displayed and the target identifier of the target data model from the data display request, the method further includes: In response to the user's interactive operation on a target control in the front-end interactive interface, determining a digital identifier of data associated with the target control to obtain the target digital identifier, wherein the target control is at least used to display data; Determine an identifier of a data model to which the data associated with the target control belongs, and obtain the target identifier; The data display request is generated based on the target digital identification and the target identifier.

6. The method according to claim 5, characterized in that Determining the digital identifier of the data associated with the target control to obtain the target digital identifier includes: Determine the data type of the data associated with the target control; In the case where the data type is an enumeration type, determining the enumeration definition referenced by the target control, and determining the enumeration value in the enumeration definition as the target digital identifier; In the case that the data type is an entity type, a target attribute in the entity model referenced by the target control is determined, and the attribute value of the target attribute is determined as the target digital identifier.

7. The method according to claim 1, characterized in that The target digital identifier is converted by the target service instance to obtain the target name of the data to be displayed, including: In the case where the target service instance is a local service, calling the target service instance based on a function call or a method call to perform name conversion processing on the target digital identifier to obtain a target name; In the case that the target service instance is a remote service, the target service instance is called based on a remote procedure call to perform name conversion processing on the target digital identifier to obtain a target name.

8. A data processing device, characterized in that: Applied to distributed systems, including: An extraction module, configured to extract, when a data display request triggered by a user is detected, a target digital identifier of the data to be displayed and a target identifier of a target data model from the data display request, wherein the target data model is a data model to which the data to be displayed belongs; A first determination module is used to determine a target service instance associated with the target data model from a plurality of service instances based on the target identifier, wherein different service instances are used to provide data identifier-to-name services for data of different data models; The processing module is used to perform name conversion processing on the target digital identifier through the target service instance to obtain the target name of the data to be displayed.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the data processing method described in any one of claims 1 to 7 when executed.

10. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the data processing method described in any one of claims 1 to 7 when running.