A method and apparatus for creating dictionary values

The method synchronizes system code and database dictionary values by retrieving enumerations during startup, ensuring system consistency and functionality.

CN113760921BActive Publication Date: 2025-07-15BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011019714.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-24
Publication Date
2025-07-15
Estimated Expiration
2040-09-24

AI Technical Summary

Technical Problem

In the prior art, dictionary enumerations in system code are prone to inconsistent with dictionary values in databases, resulting in the system being unable to operate normally.

Method used

During the system startup process, the system-level dictionary enumeration is obtained from the system code, the system-level dictionary value in the database is initialized, and the user-level dictionary value is updated through user requests to ensure that the system code is consistent with the dictionary value in the database.

Benefits of technology

It realizes dictionary value creation and non-stop initialization at system startup, ensuring that the system code is consistent with the dictionary value in the database, and ensuring the normal operation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760921B_ABST
    Figure CN113760921B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for creating dictionary values, relating to the field of computer technology. A specific implementation of the method includes: during the startup process of the system, obtaining a system-level dictionary enumeration from the system code, and initializing system-level dictionary values in the database according to the system-level dictionary enumeration; receiving a user request; obtaining a user-level dictionary enumeration corresponding to the user from the system code according to the user information carried in the user request, and updating the user-level dictionary values in the database according to the user-level dictionary enumeration; and / or; executing the user request. This implementation can solve the technical problem that it is easy to cause inconsistencies between the dictionary enumerations in the system code and the dictionary values in the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method and device for creating dictionary values. Background Art

[0002] In the prior art, dictionary values at the system level generally are in the form of SQL scripts or are manually entered into the background by developers after project deployment to add system-level dictionary values; or after a new function is developed, before going live, developers use the online system background to add system-level dictionary values required for the new function. If it is a multi-user or multi-tenant system, when creating users or tenants, user-level dictionary values are manually created in the background.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] It is easy to cause the dictionary enumeration in the system code to be inconsistent with the dictionary values in the database, resulting in the system not being able to run properly. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and device for creating dictionary values to solve the technical problem that it is easy to cause the dictionary enumeration in the system code to be inconsistent with the dictionary values in the database.

[0006] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for creating dictionary values is provided, including:

[0007] During the startup process of the system, obtain system-level dictionary enumerations from the system code, and initialize system-level dictionary values in the database according to the system-level dictionary enumerations;

[0008] Receive a user request;

[0009] According to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, and update the user-level dictionary values in the database according to the user-level dictionary enumeration; and / or; execute the user request.

[0010] Optionally, initializing system-level dictionary values in the database according to the system-level dictionary enumerations includes:

[0011] For each system-level dictionary enumeration, determine whether there is a corresponding system-level dictionary value in the database for the system-level dictionary enumeration;

[0012] If not, create a new system-level dictionary value in the database according to the value of the system-level dictionary enumeration;

[0013] If so, continue to determine whether the system level dictionary value is consistent with the value of the system level dictionary enumeration; if not, modify the system level dictionary value in the database to the value of the system level dictionary enumeration; if so, determine the system level dictionary value corresponding to the next system level dictionary enumeration.

[0014] Optionally, according to the user information carried in the user request, obtaining the user level dictionary enumeration corresponding to the user from the system code includes:

[0015] Determining the type of the user according to the user information carried in the user request;

[0016] Obtaining the user level dictionary enumeration corresponding to the type of the user from the system code.

[0017] Optionally, after updating the user level dictionary value in the database according to the user level dictionary enumeration, further includes:

[0018] Setting the update status of the user level dictionary value corresponding to the user to completed, and storing the update status of the user level dictionary value corresponding to the user and its update time in the cache.

[0019] Optionally, according to the user information carried in the user request, obtaining the user level dictionary enumeration corresponding to the user from the system code, and updating the user level dictionary value in the database according to the user level dictionary enumeration; and / or; executing the user request, includes:

[0020] Querying the update status of the user level dictionary value corresponding to the user and its update time from the cache according to the user information;

[0021] Obtaining the user level dictionary enumeration corresponding to the user from the system code according to the update status and its update time, and updating the user level dictionary value in the database; and / or; executing the user request.

[0022] Optionally, obtaining the user level dictionary enumeration corresponding to the user from the system code according to the update status and its update time, and updating the user level dictionary value in the database; and / or; executing the user request, includes:

[0023] If the update status is completed, calculate the next integrity check time according to the update time and the integrity check time interval, and determine whether the current time is later than the next integrity check time; if so, first obtain the user level dictionary enumeration corresponding to the user from the system code, update the user level dictionary value in the database, and then execute the user request; if not, directly execute the user request;

[0024] If the update status is incomplete, first obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary value in the database, and then execute the user request.

[0025] Optionally, updating the user-level dictionary value in the database according to the user-level dictionary enumeration includes:

[0026] For each user-level dictionary enumeration, determine whether a user-level dictionary value corresponding to the user-level dictionary enumeration exists in the database;

[0027] If not, create a new user-level dictionary value in the database according to the value of the user-level dictionary enumeration;

[0028] If so, continue to determine whether the user-level dictionary value is consistent with the value of the user-level dictionary enumeration; if not, modify the user-level dictionary value in the database to the value of the user-level dictionary enumeration; if so, determine the user-level dictionary value corresponding to the next user-level dictionary enumeration.

[0029] In addition, according to another aspect of the embodiments of the present invention, a device for creating dictionary values is provided, including:

[0030] A first creation module, configured to obtain a system-level dictionary enumeration from the system code during the startup of the system, and initialize the system-level dictionary value in the database according to the system-level dictionary enumeration;

[0031] A receiving module, configured to receive a user request;

[0032] A second creation module, according to the user information carried in the user request, obtains the user-level dictionary enumeration corresponding to the user from the system code, updates the user-level dictionary value in the database according to the user-level dictionary enumeration, and / or executes the user request.

[0033] Optionally, the first creation module is further configured to:

[0034] For each system-level dictionary enumeration, determine whether a system-level dictionary value corresponding to the system-level dictionary enumeration exists in the database;

[0035] If not, create a new system-level dictionary value in the database according to the value of the system-level dictionary enumeration;

[0036] If so, continue to determine whether the system-level dictionary value is consistent with the value of the system-level dictionary enumeration; if not, modify the system-level dictionary value in the database to the value of the system-level dictionary enumeration; if so, determine the system-level dictionary value corresponding to the next system-level dictionary enumeration.

[0037] Optionally, the second creation module is further configured to:

[0038] Determine the type of the user according to the user information carried in the user request;

[0039] Obtain the user level dictionary enumeration corresponding to the type of the user from the system code.

[0040] Optionally, the second creation module is further configured to:

[0041] After updating the user level dictionary value in the database according to the user level dictionary enumeration, set the update status of the user level dictionary value corresponding to the user to completed, and store the update status of the user level dictionary value corresponding to the user and its update time in the cache.

[0042] Optionally, the second creation module is further configured to:

[0043] Query the update status of the user level dictionary value corresponding to the user and its update time from the cache according to the user information;

[0044] Obtain the user level dictionary enumeration corresponding to the user from the system code according to the update status and its update time, and update the user level dictionary value in the database; and / or; execute the user request.

[0045] Optionally, the second creation module is further configured to:

[0046] If the update status is completed, calculate the next integrity check time according to the update time and the integrity check time interval, and determine whether the current time is later than the next integrity check time; if so, first obtain the user level dictionary enumeration corresponding to the user from the system code, update the user level dictionary value in the database, and then execute the user request; if not, directly execute the user request;

[0047] If the update status is not completed, first obtain the user level dictionary enumeration corresponding to the user from the system code, update the user level dictionary value in the database, and then execute the user request.

[0048] Optionally, the second creation module is further configured to:

[0049] For each of the user level dictionary enumerations, determine whether there is a user level dictionary value corresponding to the user level dictionary enumeration in the database;

[0050] If not, create a new user level dictionary value in the database according to the value of the user level dictionary enumeration;

[0051] If so, continue to determine whether the user level dictionary value is the same as the value of the user level dictionary enumeration; if not, modify the user level dictionary value in the database to the value of the user level dictionary enumeration; if so, determine the user level dictionary value corresponding to the next user level dictionary enumeration.

[0052] According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:

[0053] One or more processors;

[0054] A storage device for storing one or more programs,

[0055] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0056] According to another aspect of the embodiments of the present invention, there is also provided a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.

[0057] One of the embodiments of the above invention has the following advantages or beneficial effects: Because in the process of system startup, the system level dictionary enumeration is obtained from the system code, the system level dictionary value in the database is initialized according to the system level dictionary enumeration, after receiving a user request, the user level dictionary enumeration is obtained from the system code, and the user level dictionary value in the database is updated according to the user level dictionary enumeration, the technical problem that the dictionary enumeration in the system code is inconsistent with the dictionary value in the database in the prior art is overcome. The embodiments of the present invention can create the system level dictionary value when the system starts up, can also initialize the system level dictionary value without shutting down the machine and can periodically verify the system level dictionary value, so as to ensure that the dictionary enumeration in the system code is consistent with the dictionary value in the database, and enable the system to run normally.

[0058] The further effects of the above non-conventional optional ways will be described in combination with specific embodiments below. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:

[0060] Figure 1 is a schematic diagram of the main process of the method for creating a dictionary value according to the embodiments of the present invention;

[0061] Figure 2 is a schematic diagram of the main process of the method for creating a dictionary value according to a referenceable embodiment of the present invention;

[0062] Figure 3 It is a schematic diagram of the main process of a method for creating dictionary values according to another referenceable embodiment of the present invention;

[0063] Figure 4 It is a schematic diagram of the main modules of a device for creating dictionary values according to an embodiment of the present invention;

[0064] Figure 5 It is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;

[0065] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners

[0066] The following makes an explanation of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0067] In the prior art, when developers manually enter the background to add system-level dictionary values at the beginning of project deployment, since there are many system-level dictionary values in the system code and they are all used in the form of enumerations, this usage method has strict requirements for dictionary values. If the dictionary values do not match or do not exist, it will cause the problem that the system cannot run normally.

[0068] If the dictionary values are initialized in the form of sql scripts, since the sql scripts are separated from the system code, there may be a situation where the sql is omitted or modified incorrectly, which will also cause the dictionary values not to match or not to exist, resulting in the problem that the system cannot run normally.

[0069] If a new function of the system is launched, it may cause problems during launch because developers forget to add the system-level dictionary required for the new function. If creating user-level dictionary values when creating users or tenants, it may also cause problems during launch because developers forget to add the user-level dictionary values required for users or tenants.

[0070] The reason for the above problems is that the dictionary enumeration in the system code is inconsistent with the dictionary values in the SQL script or added to the database by developers. To solve the above technical problems, the embodiments of the present invention provide a method for creating dictionary values, which can automatically add dictionary values to the database according to the dictionary enumeration in the system code, so as to ensure the consistency between the dictionary enumeration in the system code and the dictionary values in the database.

[0071] Figure 1 It is a schematic diagram of the main process of the method for creating dictionary values according to the embodiments of the present invention. As an embodiment of the present invention, as Figure 1 shown, the method for creating dictionary values may include:

[0072] Step 101, during the system startup process, obtain the system-level dictionary enumeration from the system code, and initialize the system-level dictionary values in the database according to the system-level dictionary enumeration.

[0073] Each modification of the system-level dictionary value is usually accompanied by the modification of the system-level dictionary enumeration value in the system code. Therefore, this situation only needs to be initialized when the system starts. The embodiments of the present invention utilize the startup event listener during startup. During the system startup process, first obtain the system-level dictionary enumeration in the system code, and then initialize the system-level dictionary values in the database according to the system-level dictionary enumeration, so that the values of the system-level dictionary enumeration are consistent with the system-level dictionary values in the data dictionary added to the database, ensuring the normal operation of the system.

[0074] In the embodiments of the present invention, a dictionary generally refers to the description of a number, word, or letter corresponding to a result, which is used to facilitate the comparison and judgment of data in software engineering code, and can display corresponding friendly human-visualized information when viewed by users. Dictionaries are usually stored in the database. Among them, the dictionary values in the dictionary include key and value. The key can be a number, word, letter, etc., and the value can be the description of the result. Enumeration and dictionary can be understood to have the same meaning. However, enumeration writes the data of this corresponding relationship of the dictionary in software engineering in the form of code, and the code used to describe this corresponding relationship of the dictionary is called enumeration. Among them, the value of the enumeration is also the dictionary value.

[0075] Optionally, initialize the system-level dictionary values in the database according to the system-level dictionary enumerations, including: for each of the system-level dictionary enumerations, determine whether the database has the system-level dictionary value corresponding to the system-level dictionary enumeration; if not, create a new system-level dictionary value in the database according to the value of the system-level dictionary enumeration; if so, continue to determine whether the system-level dictionary value is consistent with the value of the system-level dictionary enumeration; if not, modify the system-level dictionary value in the database to the value of the system-level dictionary enumeration; if so, determine the system-level dictionary value corresponding to the next system-level dictionary enumeration. In an embodiment of the present invention, during the system startup process, first obtain all the system-level dictionary enumerations in the system code, and then query the database one by one to check whether there is a dictionary value corresponding to the dictionary enumeration. If it is found through database query that there is no dictionary value corresponding to the dictionary enumeration, create a new one according to the value of the dictionary enumeration; if it is found through database query that there is a dictionary value corresponding to the enumeration, but the dictionary value is different from the value in the dictionary enumeration, modify the dictionary value in the database to the value in the dictionary enumeration; if it is found through database query that there is a dictionary value corresponding to the dictionary enumeration and the dictionary value is exactly the same as the value in the dictionary enumeration, continue to query the next dictionary enumeration until all the system-level dictionary enumerations are queried.

[0076] Step 102, receive a user request.

[0077] The user request sent by the user terminal to the server carries user information, and the user information may include information such as a user identifier and a user account. In an embodiment of the present invention, the user may be a certain user in a multi-tenant or a certain tenant in a multi-tenant.

[0078] Step 103, according to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, and update the user-level dictionary value in the database according to the user-level dictionary enumeration; and / or; execute the user request.

[0079] Before the server executes the user request, first determine whether it is necessary to update the user-level dictionary value in the database. If it is necessary, first update the user-level dictionary value in the database and then execute the user request; if not, directly execute the user request.

[0080] Optionally, according to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, including: determining the type of the user according to the user information carried in the user request; obtaining the user-level dictionary enumeration corresponding to the type of the user from the system code. If each type of user has its corresponding user-level dictionary enumeration, then after parsing the user information from the user request, first match the user type according to the user information, and then obtain the user-level dictionary enumeration corresponding to the user type from the system code, so that the user-level dictionary value in the database can be updated according to the user-level dictionary enumeration.

[0081] Optionally, after updating the user-level dictionary value in the database according to the user-level dictionary enumeration, it further includes: setting the update status of the user-level dictionary value corresponding to the user to completed, and storing the update status of the user-level dictionary value corresponding to the user and its update time in the cache. In order to facilitate the periodic integrity check of the user-level dictionary value, it is necessary to record the update status of the user-level dictionary value and each update time in the cache. Therefore, the server can determine whether it is necessary to update the user-level dictionary value in the database first and then execute the user request according to the update status and update time in the cache.

[0082] Optionally, according to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, and update the user-level dictionary value in the database according to the user-level dictionary enumeration; and / or; execute the user request, including: querying the update status of the user-level dictionary value corresponding to the user and its update time from the cache according to the user information; obtaining the user-level dictionary enumeration corresponding to the user from the system code according to the update status and the update time, and updating the user-level dictionary value in the database; and / or; execute the user request. In the embodiments of the present invention, a filter can be added before the server actually executes the user request, and in the filter, query the update status of the user-level dictionary value corresponding to the user and its update time in the cache server, so as to determine whether it is necessary to update the user-level dictionary value in the database first and then execute the user request according to the update status and the update time.

[0083] Optionally, according to the update status and its update time, obtain the user-level dictionary enumeration corresponding to the user from the system code, and update the user-level dictionary value in the database; and / or; execute the user request, including: if the update status is completed, calculate the next integrity verification time according to the update time and the integrity verification time interval, and determine whether the current time is later than the next integrity verification time; if so, first obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary value in the database, and then execute the user request; if not, directly execute the user request; if the update status is not completed, first obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary value in the database, and then execute the user request. The integrity verification time interval can be pre-configured. After obtaining the update time from the cache, calculate the next integrity verification time according to the update time and the integrity verification time interval. If the current time is later than the next integrity verification time, first obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary value in the database, and then execute the user request. If the current time is earlier than the next integrity verification time, directly execute the user request.

[0084] Optionally, updating the user-level dictionary value in the database according to the user-level dictionary enumeration includes: for each user-level dictionary enumeration, determine whether there is a user-level dictionary value corresponding to the user-level dictionary enumeration in the database; if not, create a new user-level dictionary value in the database according to the value of the user-level dictionary enumeration; if so, continue to determine whether the user-level dictionary value is consistent with the value of the user-level dictionary enumeration; if not, modify the user-level dictionary value in the database to the value of the user-level dictionary enumeration; if so, determine the user-level dictionary value corresponding to the next user-level dictionary enumeration. Similar to the initialization of the system-level dictionary value, first obtain all the user-level dictionary enumerations of the user in the system code, and then query the database one by one and compare with the queried user-level dictionary values. If it is found through database query that there is no dictionary value corresponding to the dictionary enumeration, create a new one according to the value of the dictionary enumeration; if it is found through database query that there is a dictionary value corresponding to the enumeration, but the dictionary value is different from the value in the dictionary enumeration, modify the dictionary value in the database to the value in the dictionary enumeration; if it is found through database query that there is a dictionary value corresponding to the dictionary enumeration, and the dictionary value is exactly the same as the value in the dictionary enumeration, continue to query the next dictionary enumeration until all user-level dictionary enumerations are queried.

[0085] According to the various embodiments described above, it can be seen that in the embodiments of the present invention, during the system startup process, the system-level dictionary enumeration is obtained from the system code, the system-level dictionary values in the database are initialized according to the system-level dictionary enumeration, after receiving a user request, the user-level dictionary enumeration is obtained from the system code, and the user-level dictionary values in the database are updated according to the user-level dictionary enumeration. By these technical means, the technical problem in the prior art that the dictionary enumeration in the system code is likely to be inconsistent with the dictionary values in the database is solved. The embodiments of the present invention can create system-level dictionary values when the system starts up, can also initialize the system-level dictionary values without shutting down the machine and can periodically verify the system-level dictionary values, so as to ensure that the dictionary enumeration in the system code is consistent with the dictionary values in the database, enabling the system to run normally.

[0086] Figure 2 It is a schematic diagram of the main process of a method for creating dictionary values according to a reference embodiment of the present invention. As another embodiment of the present invention, as Figure 2 shown, the method for creating dictionary values may include:

[0087] Step 201, during the system startup process, obtain the system-level dictionary enumeration from the system code.

[0088] Step 202, initialize the system-level dictionary values in the database according to the system-level dictionary enumeration.

[0089] For each of the system-level dictionary enumerations, determine whether there is a corresponding system-level dictionary value in the database; if not, create a new system-level dictionary value in the database according to the value of the system-level dictionary enumeration; if so, continue to determine whether the system-level dictionary value is consistent with the value of the system-level dictionary enumeration; if not, modify the system-level dictionary value in the database to the value of the system-level dictionary enumeration; if so, determine the system-level dictionary value corresponding to the next system-level dictionary enumeration.

[0090] Step 203, receive a user request.

[0091] Step 204, determine the type of the user according to the user information carried in the user request.

[0092] If each type of user has its corresponding user-level dictionary enumeration, then after parsing the user information from the user request, it is necessary to first match the user type according to the user information.

[0093] Step 205, obtain the user-level dictionary enumeration corresponding to the type of the user from the system code.

[0094] Step 206, initialize the user level dictionary values in the database according to the enumeration of the user level dictionary.

[0095] If the user request is received for the first time, it is necessary to first initialize the user level dictionary values in the database according to the enumeration of the user level dictionary, and then execute the user request. This step is similar to step 202 and will not be elaborated here.

[0096] Step 207, set the update status of the user level dictionary value corresponding to the user to completed, and store the update status and update time of the user level dictionary value corresponding to the user in the cache.

[0097] In order to facilitate the periodic integrity check of the user level dictionary values, it is necessary to record the update status of the user level dictionary values and the update time each time in the cache. When the user request is received next time, first obtain the update status and update time from the cache to determine whether it is necessary to update the user level dictionary values in the database first and then execute the user request.

[0098] Step 208, execute the user request.

[0099] In addition, the specific implementation content of the method for creating dictionary values in a referenceable embodiment of the present invention has been described in detail in the above-mentioned method for creating dictionary values, so the repeated content will not be described here.

[0100] Figure 3 It is a schematic diagram of the main process of the method for creating dictionary values according to another referenceable embodiment of the present invention. As another embodiment of the present invention, as Figure 3 shown, the method for creating dictionary values may include:

[0101] Step 301, receive a user request.

[0102] Step 302, query the update status and update time of the user level dictionary value corresponding to the user from the cache according to the user information.

[0103] Step 303, determine whether the update status is completed; if so, execute step 304; if not, execute step 306.

[0104] Step 304, calculate the next integrity check time according to the update time and the integrity check time interval.

[0105] Step 305, determine whether the current time is later than the next integrity check time; if so, execute step 306; if not, execute step 308.

[0106] Step 306: Obtain the user-level dictionary enumeration corresponding to the user from the system code, and update the user-level dictionary value in the database.

[0107] Step 307: Set the update status of the user-level dictionary value corresponding to the user to completed, and store the update status and update time of the user-level dictionary value corresponding to the user in the cache.

[0108] Step 308: Execute the user request.

[0109] In addition, the specific implementation content of the method for creating dictionary values in another referenceable embodiment of the present invention has been described in detail in the above-mentioned method for creating dictionary values, so the repeated content will not be described here.

[0110] Figure 4 It is a schematic diagram of the main modules of the device for creating dictionary values according to an embodiment of the present invention. As Figure 4 shown, the device 400 for creating dictionary values includes a first creation module 401, a receiving module 402, and a second creation module 403. Among them, the first creation module 401 is used to obtain the system-level dictionary enumeration from the system code during the startup of the system, and initialize the system-level dictionary value in the database according to the system-level dictionary enumeration; the receiving module 402 is used to receive user requests; the second creation module 403 obtains the user-level dictionary enumeration corresponding to the user from the system code according to the user information carried in the user request, updates the user-level dictionary value in the database according to the user-level dictionary enumeration, and / or executes the user request.

[0111] Optionally, the first creation module 401 is further used for:

[0112] For each system-level dictionary enumeration, determine whether there is a system-level dictionary value corresponding to the system-level dictionary enumeration in the database;

[0113] If not, create a new system-level dictionary value in the database according to the value of the system-level dictionary enumeration;

[0114] If so, continue to determine whether the system-level dictionary value is consistent with the value of the system-level dictionary enumeration; if not, modify the system-level dictionary value in the database to the value of the system-level dictionary enumeration; if so, determine the system-level dictionary value corresponding to the next system-level dictionary enumeration.

[0115] Optionally, the second creation module 403 is further used for:

[0116] Determine the type of the user according to the user information carried in the user request;

[0117] Obtain the user level dictionary enumeration corresponding to the type of the user from the system code.

[0118] Optionally, the second creation module 403 is further configured to:

[0119] After updating the user level dictionary value in the database according to the user level dictionary enumeration, set the update status of the user level dictionary value corresponding to the user to completed, and store the update status of the user level dictionary value corresponding to the user and its update time in the cache.

[0120] Optionally, the second creation module 403 is further configured to:

[0121] Query the update status of the user level dictionary value corresponding to the user and its update time from the cache according to the user information;

[0122] Obtain the user level dictionary enumeration corresponding to the user from the system code according to the update status and its update time, and update the user level dictionary value in the database; and / or; execute the user request.

[0123] Optionally, the second creation module 403 is further configured to:

[0124] If the update status is completed, calculate the next integrity check time according to the update time and the integrity check time interval, and determine whether the current time is later than the next integrity check time; if so, first obtain the user level dictionary enumeration corresponding to the user from the system code, update the user level dictionary value in the database, and then execute the user request; if not, directly execute the user request;

[0125] If the update status is not completed, first obtain the user level dictionary enumeration corresponding to the user from the system code, update the user level dictionary value in the database, and then execute the user request.

[0126] Optionally, the second creation module 403 is further configured to:

[0127] For each of the user level dictionary enumerations, determine whether there is a user level dictionary value corresponding to the user level dictionary enumeration in the database;

[0128] If not, create a new user level dictionary value in the database according to the value of the user level dictionary enumeration;

[0129] If so, continue to determine whether the user level dictionary value is consistent with the value of the user level dictionary enumeration; if not, modify the user level dictionary value in the database to the value of the user level dictionary enumeration; if so, determine the user level dictionary value corresponding to the next user level dictionary enumeration.

[0130] According to the various embodiments described above, it can be seen that in the embodiments of the present invention, during the system startup process, the system level dictionary enumeration is obtained from the system code, the system level dictionary value in the database is initialized according to the system level dictionary enumeration, after receiving a user request, the user level dictionary enumeration is obtained from the system code, and the user level dictionary value in the database is updated according to the user level dictionary enumeration. By means of this technology, the technical problem in the prior art that the dictionary enumeration in the system code is easily inconsistent with the dictionary value in the database is solved. The embodiments of the present invention can create the system level dictionary value when the system starts, can also initialize the system level dictionary value without shutting down the machine, and can regularly verify the system level dictionary value, so as to ensure that the dictionary enumeration in the system code is consistent with the dictionary value in the database, enabling the system to run normally.

[0131] It should be noted that the specific implementation content of the device for creating dictionary values in the present invention has been described in detail in the above method for creating dictionary values, so the repeated content will not be described here again.

[0132] Figure 5 An exemplary system architecture 500 to which the method for creating dictionary values or the device for creating dictionary values according to the embodiments of the present invention can be applied is shown.

[0133] As Figure 5 shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0134] Users can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0135] The terminal devices 501, 502, 503 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.

[0136] The server 505 may be a server that provides various services. For example, it may be a back-end management server (merely an example) that supports shopping websites browsed by users using the terminal devices 501, 502, and 503. The back-end management server may analyze and process data such as item information query requests received, and feedback the processing results (such as target push information, item information - merely examples) to the terminal devices.

[0137] It should be noted that the method for creating dictionary values provided in the embodiments of the present invention is generally executed by the server 505. Correspondingly, the device for creating dictionary values is generally arranged in the server 505.

[0138] It should be understood that Figure 5 the numbers of terminal devices, networks, and servers in

[0139] are merely illustrative. According to the implementation requirements, there may be any number of terminal devices, networks, and servers. Figure 6 Refer to Figure 6 below, which shows a schematic structural diagram of a computer system 600 of a terminal device suitable for implementing the embodiments of the present invention.

[0140] As Figure 6 shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0141] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage section 608 as needed.

[0142] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program comprising a computer program carried on a computer-readable medium, which computer program contains program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-described functions defined in the system of the present invention are performed.

[0143] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0144] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0145] The modules described in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a first creation module, a receiving module, and a second creation module, where the names of these modules do not, in some cases, constitute a limitation on the module itself.

[0146] As another aspect, the present invention also provides a computer-readable medium, which can be included in the device described in the above embodiments; or can exist separately without being assembled into the device. The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device implements the following method: during the startup process of the system, obtain the system-level dictionary enumeration from the system code, and initialize the system-level dictionary values in the database according to the system-level dictionary enumeration; receive a user request; according to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, and update the user-level dictionary values in the database according to the user-level dictionary enumeration; and / or; execute the user request.

[0147] According to the technical solution of the embodiment of the present invention, during the system startup process, the system-level dictionary enumeration is obtained from the system code, and the system-level dictionary values in the database are initialized according to the system-level dictionary enumeration. After receiving a user request, the user-level dictionary enumeration is obtained from the system code, and the user-level dictionary values in the database are updated according to the user-level dictionary enumeration. Therefore, the technical problem in the prior art that the dictionary enumeration in the system code is easily inconsistent with the dictionary values in the database is overcome. The embodiment of the present invention can create the system-level dictionary values when the system starts up, can also initialize the system-level dictionary values without shutting down the machine, and can regularly verify the system-level dictionary values, so as to ensure that the dictionary enumeration in the system code is consistent with the dictionary values in the database, enabling the system to run normally.

[0148] The above specific implementation manners do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for creating dictionary values, characterized in that, Including: During the system startup process, obtain the system-level dictionary enumeration from the system code, and initialize the system-level dictionary values in the database according to the system-level dictionary enumeration; Receive a user request; Determine whether it is necessary to update the user-level dictionary values in the database; if so, according to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary values in the database according to the user-level dictionary enumeration, and then execute the user request; if not, execute the user request.

2. The method according to claim 1, characterized in that, Initializing the system-level dictionary values in the database according to the system-level dictionary enumeration includes: For each system-level dictionary enumeration, determine whether there is a system-level dictionary value corresponding to the system-level dictionary enumeration in the database; If not, create a new system-level dictionary value in the database according to the value of the system-level dictionary enumeration; If so, continue to determine whether the system-level dictionary value is consistent with the value of the system-level dictionary enumeration; if not, modify the system-level dictionary value in the database to the value of the system-level dictionary enumeration; if so, determine the system-level dictionary value corresponding to the next system-level dictionary enumeration.

3. The method according to claim 1, wherein Obtaining the user-level dictionary enumeration corresponding to the user from the system code according to the user information carried in the user request includes: Determine the type of the user according to the user information carried in the user request; Obtain the user-level dictionary enumeration corresponding to the type of the user from the system code.

4. The method according to claim 1, wherein After updating the user-level dictionary values in the database according to the user-level dictionary enumeration, it further includes: Set the update status of the user-level dictionary value corresponding to the user to completed, and store the update status and update time of the user-level dictionary value corresponding to the user in the cache.

5. The method according to claim 4, wherein Determine whether it is necessary to update the user-level dictionary values in the database; if so, according to the user information carried in the user request, obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary values in the database according to the user-level dictionary enumeration, and then execute the user request; If not, executing the user request includes: Query the update status and update time of the user-level dictionary value corresponding to the user from the cache according to the user information; Determine whether it is necessary to update the user-level dictionary values in the database; if so, according to the update status and update time, obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary values in the database, and then execute the user request; if not, execute the user request.

6. The method according to claim 5, characterized in that, Determine whether it is necessary to update the user-level dictionary values in the database; if so, according to the update status and update time, obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary values in the database, and then execute the user request; If not, executing the user request includes: If the update status is "completed", calculate the next integrity check time based on the update time and the integrity check time interval, and determine whether the current time is later than the next integrity check time; if so, first obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary value in the database, and then execute the user request; if not, directly execute the user request. If the update status is "not completed", first obtain the user-level dictionary enumeration corresponding to the user from the system code, update the user-level dictionary value in the database, and then execute the user request.

7. The method according to claim 1, characterized in that, Updating the user-level dictionary value in the database according to the user-level dictionary enumeration includes: For each user-level dictionary enumeration, determine whether there is a user-level dictionary value corresponding to the user-level dictionary enumeration in the database; If not, create a new user-level dictionary value in the database according to the value of the user-level dictionary enumeration; If so, continue to determine whether the user-level dictionary value is consistent with the value of the user-level dictionary enumeration; if not, modify the user-level dictionary value in the database to the value of the user-level dictionary enumeration; if so, determine the user-level dictionary value corresponding to the next user-level dictionary enumeration.

8. An apparatus for creating dictionary values, characterized in that, Including: A first creation module, configured to obtain a system-level dictionary enumeration from system code during system startup, and initialize the system-level dictionary value in the database according to the system-level dictionary enumeration; A receiving module, configured to receive a user request; A second creation module, configured to determine whether it is necessary to update the user-level dictionary value in the database; if so, obtain the user-level dictionary enumeration corresponding to the user from the system code according to the user information carried in the user request, update the user-level dictionary value in the database according to the user-level dictionary enumeration, and then execute the user request; if not, execute the user request.

9. An electronic device, characterized in that, Including: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, The program, when executed by a processor, implements the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and server for processing dictionary and dictionary entry

    CN105786780A

  • System configuration data table management method

    CN107544807A