CN114237806A - Page information display method and device, electronic equipment and storage medium - Google Patents

Page information display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114237806A
CN114237806A CN202111632354.4A CN202111632354A CN114237806A CN 114237806 A CN114237806 A CN 114237806A CN 202111632354 A CN202111632354 A CN 202111632354A CN 114237806 A CN114237806 A CN 114237806A
Authority
CN
China
Prior art keywords
displayed
data set
data
cache
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111632354.4A
Other languages
Chinese (zh)
Other versions
CN114237806B (en
Inventor
姜林
何渝君
张磊
陈丹丹
方清
喻妍
柯腾
邬明罡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hanyun Technology Co Ltd
Original Assignee
Hanyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hanyun Technology Co Ltd filed Critical Hanyun Technology Co Ltd
Priority to CN202111632354.4A priority Critical patent/CN114237806B/en
Publication of CN114237806A publication Critical patent/CN114237806A/en
Application granted granted Critical
Publication of CN114237806B publication Critical patent/CN114237806B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Abstract

The application provides a display method and device of page information, electronic equipment and a storage medium, wherein the display method comprises the following steps: responding to a page display request, and acquiring an object to be displayed; acquiring a table name of a data table to which an object to be displayed belongs from translation parameter information associated with the object to be displayed; acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed; and according to the object code in the object to be displayed, acquiring the translation content corresponding to the target object code in the target data set, and displaying the translation content at the corresponding position of the page. By adopting the technical scheme provided by the application, the data in the data table screened out from the database can be stored in the cache, the data in the cache is maintained through the dictionary configuration table, the translation content corresponding to the object code in the object to be displayed is inquired in the cache according to the display request of the page, and the translation content is displayed on the page, so that the translation rapidity is improved.

Description

Page information display method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of internet applications, and in particular, to a method and an apparatus for displaying page information, an electronic device, and a storage medium.
Background
A Data dictionary (Data dictionary) is an information set for describing Data, and is a set for defining all Data elements used in a system, and in a traditional small project, for a coding item, a large number of sub-queries need to be written for processing content corresponding to query field coding, so that dictionary translation is derived, the query speed can be accelerated to a certain extent, and the redundancy of codes is reduced; through the data dictionary, the display content corresponding to the code can be quickly inquired, and the display content is displayed on the page.
At present, as the data volume of a data dictionary increases, frequent query of a database to obtain corresponding translation contents causes an increase in memory overhead and a lower query efficiency; therefore, how to improve the rapidity of dictionary translation becomes a problem to be solved urgently.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for displaying page information, an electronic device, and a storage medium, which are capable of storing data in a data table screened from a database in a cache, maintaining the data in the cache through a pre-constructed dictionary configuration table, querying translation content corresponding to an object code in an object to be displayed in the cache according to a display request of a page, and displaying the translation content on the page, so as to improve the rapidity of translation.
The application mainly comprises the following aspects:
in a first aspect, an embodiment of the present application provides a method for displaying page information, where the method includes:
responding to a page display request, and acquiring an object to be displayed;
acquiring a table name of a data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed;
acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code;
and according to the object code in the object to be displayed, acquiring translation content corresponding to the target object code in the target data set, and displaying the translation content at a corresponding position of a page.
Further, the cache data set is established by the following steps:
configuring a dictionary configuration table according to translation requirements; the dictionary configuration table comprises table names of at least one data table;
acquiring target data in a corresponding data table in a database according to each table name;
and storing the acquired target data in a cache, and determining the data in the cache as a cache data set.
Further, the data table comprises at least one of a system data table and a service data table; the step of obtaining a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed comprises the following steps:
when the data table is a system data table, acquiring a corresponding target data set in a cache data set according to the table name of the data table and an object to be displayed;
when the data table is a business data table, according to the table name of the data table, the tenant identification of the object to be displayed and a target data set acquired by the object to be displayed in a cache data set; the service data table comprises at least one tenant identification, and translation contents corresponding to the same target object code in the objects to be displayed under different tenant identifications are not necessarily the same.
Further, the step before the corresponding target data set is obtained in the cache data set according to the table name of the data table and the object to be displayed includes:
detecting whether a corresponding target data set exists in a cache data set or not according to the table name of the data table and the object to be displayed;
if not, detecting whether an object to be displayed exists in the data table of the database; if so, storing a target data set corresponding to the object to be displayed in a cache data set; if not, determining the target data set corresponding to the object to be displayed as an empty set, and storing the empty set corresponding to the object to be displayed as the target data set in a cache data set;
and if so, acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed.
Further, the display method further includes:
reading a dictionary configuration table according to a preset time interval;
and acquiring current data of the corresponding data table in a database according to the table names of all the data tables configured in the dictionary configuration table, replacing target data in the cache data set with the current data, and updating the cache data set.
Further, the display method further includes:
acquiring a change request of an object to be displayed; wherein, the change request comprises at least one of modification, deletion and addition of translation content corresponding to a target code in the object to be displayed;
updating translation content corresponding to the target code in the object to be displayed in a data table corresponding to the database according to the change request, and updating a target data set of the object to be displayed in a cache data set according to the change request.
In a second aspect, an embodiment of the present application further provides a display device for page information, where the display device includes:
the first acquisition module is used for responding to the page display request and acquiring the object to be displayed;
the second acquisition module is used for acquiring the table name of the data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed;
the third acquisition module is used for acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code;
and the display module is used for acquiring translation content corresponding to the target object code in the target data set according to the object code in the object to be displayed and displaying the translation content at a corresponding position of a page.
Further, the display device further comprises a construction module, and the construction module is configured to:
configuring a dictionary configuration table according to translation requirements; the dictionary configuration table comprises table names of at least one data table;
acquiring target data in a corresponding data table in a database according to each table name;
and storing the acquired target data in a cache, and determining the data in the cache as a cache data set.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine readable instructions executable by the processor, the processor and the memory communicate through the bus when the electronic device runs, and the machine readable instructions are executed by the processor to execute the steps of the display method of the page information.
In a fourth aspect, the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for displaying page information are performed as described above.
The embodiment of the application provides a display method, a display device, electronic equipment and a storage medium of page information, wherein the display method comprises the following steps: responding to a page display request, and acquiring an object to be displayed; acquiring a table name of a data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed; acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code; and according to the object code in the object to be displayed, acquiring translation content corresponding to the target object code in the target data set, and displaying the translation content at a corresponding position of a page.
Therefore, by adopting the technical scheme provided by the application, the data in the data table screened out from the database can be stored in the cache, the data in the cache is maintained through the pre-constructed dictionary configuration table, the translation content corresponding to the object code in the object to be displayed is inquired in the cache according to the display request of the page, the translation content is displayed on the page, and the translation rapidity is improved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart illustrating a method for displaying page information according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for displaying page information according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a display device for displaying page information according to an embodiment of the present application;
fig. 4 is a second schematic structural diagram of a display device for page information according to an embodiment of the present application;
fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
To enable those skilled in the art to utilize the present disclosure, in connection with a particular application scenario "translate code for display on a page," the following embodiments are presented, and it will be apparent to those skilled in the art that the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of the present disclosure.
The method, the apparatus, the electronic device, or the computer-readable storage medium described in the embodiments of the present application may be applied to any scenario that requires dictionary translation, and the embodiments of the present application do not limit a specific application scenario, and any scheme that uses the method, the apparatus, the electronic device, and the storage medium for displaying page information provided in the embodiments of the present application is within the scope of protection of the present application.
It is worth noting that a Data dictionary (Data dictionary) is an information set for describing Data, and is a set for defining all Data elements used in a system, in a traditional small project, for a coding item, a large number of sub-queries need to be written for processing content corresponding to query field coding, so that dictionary translation is derived, query speed can be accelerated to a certain extent, and redundancy of codes is reduced; through the data dictionary, the display content corresponding to the code can be quickly inquired, and the display content is displayed on the page.
At present, as the data volume of a data dictionary increases, frequent query of a database to obtain corresponding translation contents causes an increase in memory overhead and a lower query efficiency; therefore, how to improve the rapidity of dictionary translation becomes a problem to be solved urgently.
Based on this, the present application provides a display method, an apparatus, an electronic device and a storage medium for page information, where the display method includes: responding to a page display request, and acquiring an object to be displayed; acquiring a table name of a data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed; acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code; and according to the object code in the object to be displayed, acquiring translation content corresponding to the target object code in the target data set, and displaying the translation content at a corresponding position of a page.
Therefore, by adopting the technical scheme provided by the application, the data in the data table screened out from the database can be stored in the cache, the data in the cache is maintained through the pre-constructed dictionary configuration table, the translation content corresponding to the object code in the object to be displayed is inquired in the cache according to the display request of the page, the translation content is displayed on the page, and the translation rapidity is improved.
For the purpose of facilitating an understanding of the present application, the technical solutions provided in the present application will be described in detail below with reference to specific embodiments.
Referring to fig. 1, fig. 1 is a flowchart of a method for displaying page information according to an embodiment of the present application, and as shown in fig. 1, the method includes:
s101, responding to a page display request, and acquiring an object to be displayed;
in the step, an object to be displayed is obtained in response to a page display request according to a trigger operation on a page; illustratively, when a user wants to view student information on a page and clicks a query, a background receives a display request for viewing the student information through an interface, and obtains an object to be displayed in the request, such as a student object.
S102, acquiring a table name of a data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed;
in the step, the translation parameter information is an annotation parameter in the program, is an expression mode and tells the program which things need to be processed, and the table name of the data table to which the object to be displayed belongs can be obtained through the annotation parameter; illustratively, a business system adds an annotation @ DictClass on an implementation class, adds an annotation @ DataDict on an entity class, intercepts a section before obtaining an object to be displayed and responds to a front-end page for displaying, and translates a target object code in the object to be displayed through annotation parameters; for example, a system, response entity class dto, has a field student on the attribute, and the annotation parameters are as follows:
@DataDict(source="student",dict="1",table="A");
the description shows that the student field of the object to be displayed is from the data table A, and the target object code is '1'.
S103, acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed;
in the step, the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code;
it should be noted that, before performing step S103, a cache data set needs to be constructed in advance, please refer to fig. 2, fig. 2 is a flowchart of another method for displaying page information according to an embodiment of the present application, and as shown in fig. 2, a cache data set is established through the following steps:
s201, configuring a dictionary configuration table according to translation requirements;
in the step, a dictionary configuration table comprises a table name of at least one data table, and the dictionary configuration table is used for maintaining data in a Redis cache; illustratively, a table name of a data table is deleted in the dictionary configuration table, and when the Redis cache is updated, data in the data table is deleted in the Redis cache, so that maintainability of dictionary translation is improved.
S202, acquiring target data in a corresponding data table in a database according to each table name;
in this step, target data is obtained in a corresponding data table of the database according to a table name of the data table configured in the dictionary configuration table, where the target data is data to be placed in the Redis cache for translation. And the dictionary translation is independent into a service, when the dictionary translation service is started, another thread is started to carry out initialization query on the configured dictionary configuration table, the table name of the data table configured in the table is obtained, and the target data in the corresponding data table is obtained in the database according to each table name.
S203, storing the acquired target data in a cache, and determining the data in the cache as a cache data set.
In the step, a plurality of target data acquired from a plurality of data tables of a database are stored in a Redis cache as a cache data set; illustratively, A, B two tables are configured in the dictionary configuration table, and a codeA1 field is provided in the table a, wherein the codeA1 field includes object codes in the form of numbers 1 and 2, and each object code (number) has a corresponding chinese meaning; the table B has a codeB1 field and a tenant identification field (used for distinguishing the meanings of the same codeB1 under different tenant identifications), the codeB1 field includes object codes in digital forms of 1 and 2, each object code (number) has a corresponding Chinese meaning, and target data in A, B two tables are assembled into a key-value pair form and stored in a Redis cache; for example, the assembled key-value pair form is as follows:
a: : codeA1, tenant 1: : b: : codeB1, tenant 2: : b: : codeB 1;
these pieces of target data are stored in Redis as a cache data set.
After the cache data set is constructed and before step S103, that is, before the corresponding target data set is obtained in the cache data set according to the table name of the data table and the object to be displayed, the method includes:
1) detecting whether a corresponding target data set exists in the cache data set or not according to the table name of the data table and the object to be displayed;
in the step, according to the table name of the data table obtained in the step S102, whether a target data set corresponding to an object to be displayed in the table name exists in the cache data set is queried; illustratively, the acquired table name is a, the object to be displayed is a student, and whether a: : the target dataset of the student.
2) If the object to be displayed does not exist, detecting whether the object to be displayed exists in the data table of the database; if so, storing a target data set corresponding to the object to be displayed in a cache data set; if not, determining the target data set corresponding to the object to be displayed as an empty set, and storing the empty set corresponding to the object to be displayed as the target data set in a cache data set;
in this step, if the query result does not exist, it indicates that there is no data of the object to be displayed in the Redis cache, and the query is required to be performed in the database, and if the object to be displayed is found in the data table corresponding to the database, the target data set corresponding to the object to be displayed is stored in the Redis cache, so that the object to be displayed can be directly obtained from the Redis cache in the next query without querying the database again; and if not, determining the corresponding target data set as an empty set, storing the empty set as the target data set in the Redis cache, and directly returning the empty set when the object to be displayed is received again, so that the database does not need to be queried again, cache breakdown is prevented, and the database is queried frequently.
3) And if the target data set exists, acquiring the corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed.
In the step, the data table comprises at least one of a system data table and a service data table; the method comprises the following steps of obtaining a corresponding target data set in a cache data set according to a table name of a data table and an object to be displayed, wherein the steps comprise:
s1031, when the data table is a system data table, acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed;
in this step, when the table name of the obtained data table is the system data table, it indicates that, for all users, the translation content corresponding to the target object code in the same object to be displayed is the same, and there is no need to distinguish the users, so it is only necessary to obtain the target data set in the Redis cache data set by the table name of the data table and the object to be displayed.
S1032, when the data table is a service data table, according to the table name of the data table, the tenant identification of the object to be displayed and a target data set acquired by the object to be displayed in the cache data set; the service data table comprises at least one tenant identification, and translation contents corresponding to the same target object code in the objects to be displayed under different tenant identifications are not necessarily the same.
In this step, when the table name of the obtained data table is a service data table, it indicates that, for different users, translation contents corresponding to target object codes in the same object to be displayed are not necessarily the same, so that users need to be distinguished, and a target data set is obtained in a Redis cache data set through the table name of the data table, a tenant identifier of the object to be displayed, and the object to be displayed; illustratively, the Redis cache data set is as follows:
a: : codeA1, a: : codeA2, a: : codeA3, tenant 1: : b: : codeB1, tenant 1: : b: : codeB2, tenant 2: : b: : codeB1, tenant 3: : b: : codeB 1;
if the name of the acquired data table is B, the tenant identifier is tenant 1, and the object to be displayed is codeB1, the target data set acquired in the Redis cache data set is tenant 1: : b: : codeB 1.
S104, according to the object code in the object to be displayed, obtaining the translation content corresponding to the target object code in the target data set, and displaying the translation content at the corresponding position of the page.
In the step, the object to be displayed comprises at least one object code, each object code has translation content corresponding to the object code, a ConcurrentHashMap hash set is added after the obtained target data set is obtained, the target object code is translated through reflection, the corresponding translation content is assigned to the target object code, the response is given to the front end, and the translation content is displayed at the corresponding position of the page. Illustratively, the key of the acquired target data set is tenant 1: : b: : student, value is { 1: tom; 2: lina; 3: annie, if the target object code is 2, assigning Lina to the target object code 2, and displaying the Lina at the corresponding position of the page.
In an embodiment of the present application, there are also provided two methods for updating a cached data set, where the first step of updating the cached data set includes:
1) acquiring a change request of an object to be displayed;
in the step, the first update Redis cache data set is updated in real time through a change request of an interface, and the change request of the object to be displayed on the front-end page is acquired through the interface, wherein the change request includes at least one of modification, deletion and addition of translation content corresponding to a target code in the object to be displayed.
2) Updating translation content corresponding to the target code in the object to be displayed in a data table corresponding to the database according to the change request, and updating a target data set of the object to be displayed in a cache data set according to the change request.
In the step, the translation content corresponding to the target code of the object to be displayed in the corresponding data table of the database and the target data set of the object to be displayed in the Redis cache data set are updated simultaneously; exemplarily, the name of the student is modified from tom to lisa on the configuration page, after the change request is obtained, the database and the Redis are updated at the same time, the name of the student in the database A table is modified from tom to lisa, and the key in the Redis cache data set is A: : value { 1: tom; 2: annie updates the target dataset to value { 1: lisa; 2: annie }. And the Redis cache data set is updated in real time through an external exposure interface, so that the translation accuracy is ensured.
A second step of updating the cached data set, comprising:
1) reading a dictionary configuration table according to a preset time interval;
in the step, a timing task can be set, a dictionary configuration table is read according to a preset time interval, and a Redis cache data set is updated; illustratively, the dictionary configuration table is read every morning to update the cached data set.
2) And acquiring current data of the corresponding data table in the database according to the table names of all the data tables configured in the dictionary configuration table, replacing target data in the cache data set with the current data, and updating the cache data set.
In the step, current data under the data table of the table name in the database is obtained according to the table names of all the data tables configured in the dictionary configuration table, target data in the cache data set is replaced by the current data, the cache data set is updated, and the cache data set is prevented from being not updated and the accuracy of translation is prevented from being influenced; illustratively, when a table name of a certain data table is added to a dictionary configuration table, target data of the table in a database needs to be added to a Redis cache; illustratively, tom is changed into lisa by modifying a configuration page, translation content corresponding to code 1 of a table student field in a corresponding database is updated to tom, if Redis is suspended during the change and is not updated in real time, after Redis is restarted, a Redis cache data set is still stored tom, if the Redis cache data set is not updated regularly, displayed tom on a front-end page is still tom, and therefore the dictionary configuration table is configured with an a table, and the accuracy of translation is ensured by updating the Redis cache data set regularly.
It should be noted that, for data that is not used for a long time, the Redis cache data set may be deleted, and data with expired data and low usage rate may be processed, so as to save memory space of the Redis.
The display method of the page information provided by the embodiment of the application comprises the following steps: responding to a page display request, and acquiring an object to be displayed; acquiring a table name of a data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed; acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code; and according to the object code in the object to be displayed, acquiring translation content corresponding to the target object code in the target data set, and displaying the translation content at a corresponding position of a page.
Therefore, by adopting the technical scheme provided by the application, the data in the data table screened out from the database can be stored in the cache, the data in the cache is maintained through the pre-constructed dictionary configuration table, the translation content corresponding to the object code in the object to be displayed is inquired in the cache according to the display request of the page, the translation content is displayed on the page, and the translation rapidity is improved.
Based on the same application concept, the embodiment of the present application further provides a display apparatus for page information corresponding to the display method for page information provided by the above embodiment, and as the principle of the apparatus in the embodiment of the present application for solving the problem is similar to the display method for page information provided by the above embodiment of the present application, the implementation of the apparatus can refer to the implementation of the method, and repeated details are omitted.
Referring to fig. 3 and 4, fig. 3 is a first structural diagram of a display structure of page information provided in an embodiment of the present application, and fig. 4 is a second structural diagram of a display structure of page information provided in an embodiment of the present application. As shown in fig. 3, the display device 310 includes:
a first obtaining module 311, configured to obtain an object to be displayed in response to a page display request;
a second obtaining module 312, configured to obtain, from the translation parameter information associated with the object to be displayed, a table name of a data table to which the object to be displayed belongs;
a third obtaining module 313, configured to obtain a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code;
the display module 314 is configured to obtain, according to the object code in the object to be displayed, translation content corresponding to the target object code in the target data set, and display the translation content at a corresponding position of a page.
Optionally, as shown in fig. 4, the display apparatus 310 further includes a building module 315, where the building module 315 is configured to:
configuring a dictionary configuration table according to translation requirements; the dictionary configuration table comprises table names of at least one data table;
acquiring target data in a corresponding data table in a database according to each table name;
and storing the acquired target data in a cache, and determining the data in the cache as a cache data set.
Optionally, the data table includes at least one of a system data table and a service data table; when the third obtaining module 313 is configured to obtain the corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed, the third obtaining module 313 is specifically configured to:
when the data table is a system data table, acquiring a corresponding target data set in a cache data set according to the table name of the data table and an object to be displayed;
when the data table is a business data table, according to the table name of the data table, the tenant identification of the object to be displayed and a target data set acquired by the object to be displayed in a cache data set; the service data table comprises at least one tenant identification, and translation contents corresponding to the same target object code in the objects to be displayed under different tenant identifications are not necessarily the same.
Optionally, as shown in fig. 4, the display device 310 further includes a determining module 316, where the determining module 316 is configured to:
detecting whether a corresponding target data set exists in a cache data set or not according to the table name of the data table and the object to be displayed;
if not, detecting whether an object to be displayed exists in the data table of the database; if so, storing a target data set corresponding to the object to be displayed in a cache data set; if not, determining the target data set corresponding to the object to be displayed as an empty set, and storing the empty set corresponding to the object to be displayed as the target data set in a cache data set;
and if so, acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed.
Optionally, as shown in fig. 4, the display device 310 further includes a first updating module 317, where the first updating module 317 is configured to:
reading a dictionary configuration table according to a preset time interval;
and acquiring current data of the corresponding data table in a database according to the table names of all the data tables configured in the dictionary configuration table, replacing target data in the cache data set with the current data, and updating the cache data set.
Optionally, as shown in fig. 4, the display device 310 further includes a second updating module 318, where the second updating module 318 is configured to:
acquiring a change request of an object to be displayed; wherein, the change request comprises at least one of modification, deletion and addition of translation content corresponding to a target code in the object to be displayed;
updating translation content corresponding to the target code in the object to be displayed in a data table corresponding to the database according to the change request, and updating a target data set of the object to be displayed in a cache data set according to the change request.
The display device of page information that this application embodiment provided, display device includes: the first acquisition module is used for responding to the page display request and acquiring the object to be displayed; the second acquisition module is used for acquiring the table name of the data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed; the third acquisition module is used for acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code; and the display module is used for acquiring translation content corresponding to the target object code in the target data set according to the object code in the object to be displayed and displaying the translation content at a corresponding position of a page.
Therefore, by adopting the technical scheme provided by the application, the data in the data table screened out from the database can be stored in the cache, the data in the cache is maintained through the pre-constructed dictionary configuration table, the translation content corresponding to the object code in the object to be displayed is inquired in the cache according to the display request of the page, the translation content is displayed on the page, and the translation rapidity is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
The memory 520 stores machine-readable instructions executable by the processor 510, when the electronic device 500 runs, the processor 510 communicates with the memory 520 through the bus 530, and when the machine-readable instructions are executed by the processor 510, the steps of the method for displaying page information in the method embodiments shown in fig. 1 and fig. 2 may be performed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for displaying page information in the method embodiments shown in fig. 1 and fig. 2 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for displaying page information is characterized by comprising the following steps:
responding to a page display request, and acquiring an object to be displayed;
acquiring a table name of a data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed;
acquiring a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code;
and according to the object code in the object to be displayed, acquiring translation content corresponding to the target object code in the target data set, and displaying the translation content at a corresponding position of a page.
2. The display method according to claim 1, wherein the cache data set is created by:
configuring a dictionary configuration table according to translation requirements; the dictionary configuration table comprises table names of at least one data table;
acquiring target data in a corresponding data table in a database according to each table name;
and storing the acquired target data in a cache, and determining the data in the cache as a cache data set.
3. The display method according to claim 1, wherein the data table comprises at least one of a system data table and a service data table; the step of obtaining a corresponding target data set in a cache data set according to the table name of the data table and the object to be displayed comprises the following steps:
when the data table is a system data table, acquiring a corresponding target data set in a cache data set according to the table name of the data table and an object to be displayed;
when the data table is a business data table, according to the table name of the data table, the tenant identification of the object to be displayed and a target data set acquired by the object to be displayed in a cache data set; the service data table comprises at least one tenant identification, and translation contents corresponding to the same target object code in the objects to be displayed under different tenant identifications are not necessarily the same.
4. The display method according to claim 1, wherein the step of obtaining the corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed comprises:
detecting whether a corresponding target data set exists in a cache data set or not according to the table name of the data table and the object to be displayed;
if not, detecting whether an object to be displayed exists in the data table of the database; if so, storing a target data set corresponding to the object to be displayed in a cache data set; if not, determining the target data set corresponding to the object to be displayed as an empty set, and storing the empty set corresponding to the object to be displayed as the target data set in a cache data set;
and if so, acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed.
5. The display method according to claim 1, further comprising:
reading a dictionary configuration table according to a preset time interval;
and acquiring current data of the corresponding data table in a database according to the table names of all the data tables configured in the dictionary configuration table, replacing target data in the cache data set with the current data, and updating the cache data set.
6. The display method according to claim 1, further comprising:
acquiring a change request of an object to be displayed; wherein, the change request comprises at least one of modification, deletion and addition of translation content corresponding to a target code in the object to be displayed;
updating translation content corresponding to the target code in the object to be displayed in a data table corresponding to the database according to the change request, and updating a target data set of the object to be displayed in a cache data set according to the change request.
7. A display device of page information, characterized in that the display device comprises:
the first acquisition module is used for responding to the page display request and acquiring the object to be displayed;
the second acquisition module is used for acquiring the table name of the data table to which the object to be displayed belongs from the translation parameter information associated with the object to be displayed;
the third acquisition module is used for acquiring a corresponding target data set in the cache data set according to the table name of the data table and the object to be displayed; the cache data set is a set of target data of a data table screened from a database according to translation requirements; the target data set comprises at least one object code in the objects to be displayed and a set of translation contents corresponding to each object code;
and the display module is used for acquiring translation content corresponding to the target object code in the target data set according to the object code in the object to be displayed and displaying the translation content at a corresponding position of a page.
8. The display device of claim 7, further comprising a construction module to:
configuring a dictionary configuration table according to translation requirements; the dictionary configuration table comprises table names of at least one data table;
acquiring target data in a corresponding data table in a database according to each table name;
and storing the acquired target data in a cache, and determining the data in the cache as a cache data set.
9. An electronic device, comprising: processor, memory and bus, the memory stores machine readable instructions executable by the processor, when the electronic device runs, the processor and the memory communicate through the bus, the machine readable instructions are executed by the processor to execute the steps of the display method of page information according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, performs the steps of the method for displaying page information according to any one of claims 1 to 6.
CN202111632354.4A 2021-12-29 2021-12-29 Page information display method and device, electronic equipment and storage medium Active CN114237806B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111632354.4A CN114237806B (en) 2021-12-29 2021-12-29 Page information display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111632354.4A CN114237806B (en) 2021-12-29 2021-12-29 Page information display method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114237806A true CN114237806A (en) 2022-03-25
CN114237806B CN114237806B (en) 2024-03-12

Family

ID=80743941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111632354.4A Active CN114237806B (en) 2021-12-29 2021-12-29 Page information display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114237806B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115438279A (en) * 2022-08-10 2022-12-06 珠海金智维信息科技有限公司 Data visualization method and device, electronic equipment and medium

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170201416A1 (en) * 2016-01-12 2017-07-13 Fastly, Inc. Management of edge dictionary containers in content nodes of a content delivery network
WO2019153553A1 (en) * 2018-02-12 2019-08-15 平安科技(深圳)有限公司 Cross wide area network data return method and apparatus, computer device, and storage medium
CN110263130A (en) * 2019-06-27 2019-09-20 深圳前海微众银行股份有限公司 Page info processing method, device and storage medium
CN110362776A (en) * 2019-07-23 2019-10-22 深圳前海微众银行股份有限公司 Browser front-end data storage method, device, equipment and readable storage medium storing program for executing
CN110377649A (en) * 2019-06-17 2019-10-25 中国平安财产保险股份有限公司 Building, querying method, device, equipment and the storage medium of labeling data
WO2020015150A1 (en) * 2018-07-18 2020-01-23 平安科技(深圳)有限公司 Method and device for dynamically exporting data table, computer apparatus, and storage medium
US20200073989A1 (en) * 2018-09-05 2020-03-05 Sap Se Identification, and query, of semantically-related database tables
CN111190928A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Cache processing method and device, computer equipment and storage medium
CN111475553A (en) * 2020-04-09 2020-07-31 五八有限公司 Data query display method and device, electronic equipment and storage medium
CN111708804A (en) * 2020-06-11 2020-09-25 中国建设银行股份有限公司 Data processing method, device, equipment and medium
US20200320213A1 (en) * 2019-04-02 2020-10-08 Sap Se Secure Database Utilizing Dictionary Encoding
CN112347794A (en) * 2020-10-27 2021-02-09 深圳前海微众银行股份有限公司 Data translation method, device, equipment and computer storage medium
CN112506946A (en) * 2020-12-03 2021-03-16 平安科技(深圳)有限公司 Service data query method, device, equipment and storage medium
CN112765215A (en) * 2021-01-19 2021-05-07 上海幻电信息科技有限公司 Data query method and device
US20210234669A1 (en) * 2020-01-29 2021-07-29 Salesforce.Com, Inc. Using cache objects to store events for adding corresponding objects in a blockchain
WO2021175021A1 (en) * 2020-03-06 2021-09-10 深圳壹账通智能科技有限公司 Product push method and apparatus, computer device, and storage medium
CN113590713A (en) * 2021-07-29 2021-11-02 中国建设银行股份有限公司 Distributed system parameter synchronization method and device, electronic equipment and computer readable storage medium
CN113835692A (en) * 2021-09-27 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Dictionary data processing method and device, electronic equipment and computer storage medium

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170201416A1 (en) * 2016-01-12 2017-07-13 Fastly, Inc. Management of edge dictionary containers in content nodes of a content delivery network
WO2019153553A1 (en) * 2018-02-12 2019-08-15 平安科技(深圳)有限公司 Cross wide area network data return method and apparatus, computer device, and storage medium
WO2020015150A1 (en) * 2018-07-18 2020-01-23 平安科技(深圳)有限公司 Method and device for dynamically exporting data table, computer apparatus, and storage medium
US20200073989A1 (en) * 2018-09-05 2020-03-05 Sap Se Identification, and query, of semantically-related database tables
US20200320213A1 (en) * 2019-04-02 2020-10-08 Sap Se Secure Database Utilizing Dictionary Encoding
CN110377649A (en) * 2019-06-17 2019-10-25 中国平安财产保险股份有限公司 Building, querying method, device, equipment and the storage medium of labeling data
CN110263130A (en) * 2019-06-27 2019-09-20 深圳前海微众银行股份有限公司 Page info processing method, device and storage medium
CN110362776A (en) * 2019-07-23 2019-10-22 深圳前海微众银行股份有限公司 Browser front-end data storage method, device, equipment and readable storage medium storing program for executing
CN111190928A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Cache processing method and device, computer equipment and storage medium
US20210234669A1 (en) * 2020-01-29 2021-07-29 Salesforce.Com, Inc. Using cache objects to store events for adding corresponding objects in a blockchain
WO2021175021A1 (en) * 2020-03-06 2021-09-10 深圳壹账通智能科技有限公司 Product push method and apparatus, computer device, and storage medium
CN111475553A (en) * 2020-04-09 2020-07-31 五八有限公司 Data query display method and device, electronic equipment and storage medium
CN111708804A (en) * 2020-06-11 2020-09-25 中国建设银行股份有限公司 Data processing method, device, equipment and medium
CN112347794A (en) * 2020-10-27 2021-02-09 深圳前海微众银行股份有限公司 Data translation method, device, equipment and computer storage medium
CN112506946A (en) * 2020-12-03 2021-03-16 平安科技(深圳)有限公司 Service data query method, device, equipment and storage medium
CN112765215A (en) * 2021-01-19 2021-05-07 上海幻电信息科技有限公司 Data query method and device
CN113590713A (en) * 2021-07-29 2021-11-02 中国建设银行股份有限公司 Distributed system parameter synchronization method and device, electronic equipment and computer readable storage medium
CN113835692A (en) * 2021-09-27 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Dictionary data processing method and device, electronic equipment and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
不贪吃的蛇: "@Dict注解实现简单字典翻译", Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/447926305> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115438279A (en) * 2022-08-10 2022-12-06 珠海金智维信息科技有限公司 Data visualization method and device, electronic equipment and medium

Also Published As

Publication number Publication date
CN114237806B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
CN109074383B (en) Document search with visualization within the context of a document
CN110851209B (en) Data processing method and device, electronic equipment and storage medium
WO2017044180A1 (en) Identifying software components in a software codebase
CN104391725A (en) Page display method and page display device
WO2020211236A1 (en) Read-write conflict resolution method and apparatus employing b+ tree and storage medium
US9235613B2 (en) Flexible partitioning of data
JP2012089094A5 (en)
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
CN110909000B (en) Data processing method, system, device and computer readable storage medium
CN114237806A (en) Page information display method and device, electronic equipment and storage medium
WO2019161620A1 (en) Application dependency update method, terminal and device, and storage medium
CN108763341B (en) Electronic device, automatic table building method and storage medium
CN108763524B (en) Electronic device, chatting data processing method, and computer-readable storage medium
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
JP6648307B2 (en) Electronic device, method for deduplicating name list entry, and computer-readable storage medium
CN112100092A (en) Information caching method, device, equipment and medium
CN115732052A (en) Case report table generation method and device based on structured clinical project
CN115291931A (en) Version change processing method and device, electronic equipment and storage medium
US10866993B2 (en) Managing online help information in a data center
JP2018109898A (en) Data migration system
CN112685078A (en) Interface document generation and query method, device and computer readable storage medium
US20060212533A1 (en) Minimizing Problems in Accessing Referred Content
CN111966388A (en) Space-saving mirror image version update management method, device, equipment and medium
CN110851456B (en) Information processing method, electronic equipment and storage medium
US10685046B2 (en) Data processing system and data processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant