Text resource management method, device, and storage medium
By using a master-slave hierarchical storage mechanism for resources in the resource management terminal, the problem of large development workload in multi-language adaptation is solved, and efficient and unified management and stable use of text resources are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HUACHENG SOFTWARE TECH CO LTD
- Filing Date
- 2023-08-14
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, software applications or web pages need to be developed for each language version when adapting to multiple languages, resulting in a large workload for development and complex text resource management.
Text resources are managed uniformly through a resource management terminal, using a hierarchical storage method of master and slave resources. The master resource contains the original text, while the slave resource contains the modified text. The text is stored and distributed in association based on index identifiers to meet the needs of different resource users.
This reduces the workload of text development, ensures the efficiency and stability of multilingual use, and avoids impacting other resource users.
Smart Images

Figure CN117216181B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a text resource management method, device and storage medium. Background Technology
[0002] Currently, software applications or web pages generally render and display text content by referencing corresponding text resources. However, as people's demand for personalized services increases, the management of text resources is becoming more complex.
[0003] For example, when a software application or website targets users in multiple languages, the same application needs to be developed in multiple different languages for users of different languages. During the development of the software application or website, the text information to be displayed to users needs to be adapted for multiple languages to ensure that users in different countries can use the software application or website in their familiar native language.
[0004] However, this requires development in different languages for each software application or webpage, resulting in a large development workload and making text resources difficult to manage. Summary of the Invention
[0005] This application provides at least one text resource management method, device, and storage medium.
[0006] The first aspect of this application provides a text resource management method applied to a resource management terminal. The resource management terminal provides text resources to at least two resource users. The text resources are used to render and display text content in a display interface. The method includes: obtaining a text resource to be stored, the text resource carrying an index identifier; querying whether an index identifier corresponding to the text resource to be stored exists in a text resource set, the text resource set being used to store text resources and their corresponding index identifiers, the stored text resources having a resource type including master database resources and slave database resources; if an index identifier corresponding to the text resource to be stored exists in the text resource set, obtaining the master database resource corresponding to the existing index identifier, and associating the text resource to be stored as a slave database resource with the master database resource; receiving a resource acquisition request sent by a resource user, selecting a master database resource or a slave database resource from the text resource set according to preset conditions and returning it to the resource user, so that the resource user can render and display the master database resource or the slave database resource.
[0007] In one embodiment, the resource acquisition request carries an index identifier; receiving the resource acquisition request sent by the resource user, and selecting a master library resource or a slave library resource from the text resource set according to preset conditions and returning it to the resource user so that the resource user can render and display the master library resource or the slave library resource, includes: selecting the master library resource and the slave library resource associated with the index identifier corresponding to the resource acquisition request from the text resource set to obtain candidate text resources; selecting the target text resource from multiple candidate text resources according to preset conditions; and returning the target text resource to the resource user so that the resource user can render and display the target text resource.
[0008] In one embodiment, the resource acquisition request also carries resource description information; selecting the target text resource from the candidate text resources according to preset conditions includes: filtering multiple candidate text resources based on the resource description information to obtain the target text resource.
[0009] In one embodiment, the resource description information is the resource description information of a slave library; the process of filtering multiple candidate text resources based on the resource description information to obtain the target text resource includes: detecting whether there is a slave library resource among the multiple candidate text resources that matches the slave library resource description information; if there is a slave library resource that matches the slave library resource description information, then the matching slave library resource is taken as the target text resource; if there is no slave library resource that matches the slave library resource description information, then the master library resource among the multiple candidate text resources is taken as the target text resource.
[0010] In one embodiment, a list of associated identifiers corresponds to a text resource. The list of associated identifiers stores the identifier information of the associated resource users corresponding to the text resource. Selecting a target text resource from candidate text resources according to preset conditions includes: obtaining the identifier information corresponding to the resource user and obtaining the list of associated identifiers corresponding to each candidate text resource; detecting whether there is identifier information corresponding to the resource user in each list of associated identifiers; and taking the candidate text resource corresponding to the list of associated identifiers with identifier information corresponding to the resource user as the target text resource.
[0011] In one embodiment, the candidate text resources corresponding to the associated identifier list with the identifier information corresponding to the resource user end are used as the target text resources. This includes: if there is no identifier information corresponding to the resource user end in each associated identifier list, then the main library resource among the multiple candidate text resources is used as the target text resource.
[0012] In one embodiment, the method further includes: if there is no index identifier corresponding to the text resource to be stored in the text resource set, then the text resource to be stored is associated with the index identifier as a main library resource.
[0013] In one embodiment, the text resource is a multilingual text resource.
[0014] The second aspect of this application provides a text resource management device deployed on a resource management terminal. The resource management terminal provides text resources to at least two resource users. The text resources are used for rendering and displaying text content in a display interface. The device includes: a resource acquisition module for acquiring text resources to be stored, wherein the text resources to be stored carry an index identifier; a query module for querying whether an index identifier corresponding to the text resource to be stored exists in a text resource set, wherein the text resource set stores text resources and their corresponding index identifiers, and the stored text resources contain master database resources and slave database resources; a storage module for acquiring the master database resource corresponding to the existing index identifier if an index identifier corresponding to the text resource to be stored exists in the text resource set, and associating the text resource to be stored as a slave database resource with the master database resource; and an acquisition request processing module for receiving resource acquisition requests sent by resource users, selecting master database resources or slave database resources from the text resource set according to preset conditions and returning them to the resource users so that the resource users can render and display the master database resources or slave database resources.
[0015] A third aspect of this application provides an electronic device, including a memory and a processor, wherein the processor is configured to execute program instructions stored in the memory to implement the above-described text resource management method.
[0016] The fourth aspect of this application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-described text resource management method.
[0017] The above solution provides text resources to at least two resource users through a resource management terminal, enabling unified management of text resources across multiple users. It retrieves text resources to be stored, each carrying an index identifier. The solution checks if the corresponding index identifier exists in the text resource set. The set contains both master and slave resources. If the index identifier exists, the solution retrieves the corresponding master resource and associates it with the master resource. The solution receives resource retrieval requests from users and selects either a master or slave resource from the set based on preset conditions, returning it to the user. This hierarchical storage of master and slave resources allows a single text resource to be used by multiple users, reducing development workload while ensuring differentiated use across different users. It also prevents changes to text resources from affecting other users, improving the efficiency and stability of multi-language usage.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0020] Figure 1 This is a schematic diagram illustrating an implementation environment of a text resource management method according to an exemplary embodiment of this application;
[0021] Figure 2 This is a flowchart illustrating a text resource management method in an exemplary embodiment of this application;
[0022] Figure 3 This is a schematic diagram illustrating a collection of text resources in an exemplary embodiment of this application;
[0023] Figure 4 This is a flowchart illustrating a text resource management method in another exemplary embodiment of this application;
[0024] Figure 5 This is a flowchart illustrating the determination of a target text resource, as shown in an exemplary embodiment of this application;
[0025] Figure 6 This is a block diagram illustrating a text resource management device in an exemplary embodiment of this application;
[0026] Figure 7 This is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of this application;
[0027] Figure 8 This is a schematic diagram illustrating the structure of a computer-readable storage medium, as shown in an exemplary embodiment of this application. Detailed Implementation
[0028] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0029] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0030] In this document, the term "and / or" is merely a description of the association information of related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0031] The text resource management method provided in the embodiments of this application will be described below.
[0032] Please see Figure 1 , Figure 1 This is a schematic diagram of an implementation environment involved in the text resource management method of this application. For example... Figure 1 As shown, the implementation environment includes a resource generation terminal 110, a resource management terminal 120, and a resource user terminal 130. The resource management terminal 120 directly or indirectly connects to the resource generation terminal 110 and the resource user terminal 130 via wired or wireless communication.
[0033] The resource generation terminal 110 and the resource user terminal 130 can be mobile phones, computers, laptops, smart home appliances, etc., but are not limited to these. Those skilled in the art will understand that the number of the aforementioned resource generation terminal and resource user terminal can be only one, or there can be dozens, hundreds, or more. In this case, the implementation environment of the aforementioned text resource management method also includes other resource generation terminals and resource user terminals. This application embodiment does not limit the number or device type of the resource generation terminal and resource user terminal.
[0034] The resource management terminal 120 can be a server. A server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0035] The resource generation terminal 110 is used to generate text resources, such as obtaining text resources by detecting input operations performed by developers. The resource management terminal 120 is used to uniformly manage text resources to provide text resources to the resource user terminal 130, thereby realizing the rendering and display of text content.
[0036] For example, the resource generation terminal 110 receives input from the developer to obtain the text resource to be stored, and uploads the text resource to be stored to the resource management terminal 120. The resource management terminal 120 obtains the text resource to be stored uploaded by the resource generation terminal 110, and queries whether the index identifier corresponding to the text resource to be stored exists in the text resource set according to the index identifier corresponding to the text resource to be stored. If it exists, it means that the index identifier already has a master library resource, and the text resource to be stored is associated with the master library resource as a slave library resource; if it does not exist, it means that there is no text resource corresponding to the index identifier in the text resource set, and the text resource to be stored is directly associated with the index identifier as a master library resource. Then, in response to the resource acquisition request sent by the resource user terminal 130, the resource user terminal 130 selects a master library resource or a slave library resource from the text resource set according to preset conditions and returns it to the resource user terminal 130 so that the resource user terminal 130 can render and display the returned master library resource or slave library resource.
[0037] This application enables unified management of text resources across multiple resource users, allowing a single text resource to be referenced by multiple users, thus reducing the workload of text development. Furthermore, considering that some resource users may need to modify text resources, this application establishes a master and slave database system. The modified text resource is designated as the slave database resource, while the original text resource serves as the master database resource. This ensures differentiated use across multiple resource users, prevents changes to text resources from affecting other resource users, and improves the efficiency and stability of multi-language usage.
[0038] Understandable, Figure 1 The implementation environment shown is only illustrative. In actual applications, the resource generation end, resource management end, and resource usage end can be integrated and deployed, or other devices not shown in the implementation environment can implement the functions corresponding to the resource generation end, resource management end, or resource usage end. This application does not limit this.
[0039] Please see Figure 2 , Figure 2 This is a flowchart illustrating a text resource management method in an exemplary embodiment of this application. This text resource management method can be applied to... Figure 1 The implementation environment shown is specifically executed by the resource management terminal within that implementation environment. It should be understood that this method can also be applied to other exemplary implementation environments and executed by devices in other implementation environments; this embodiment does not limit the implementation environment to which the method is applicable.
[0040] like Figure 2 As shown, the text resource management method includes at least steps S210 to S240, which are described in detail below:
[0041] Step S210: Obtain the text resource to be stored, which carries an index identifier.
[0042] Among them, text resources are used to render and display text content in the display interface, such as for the display management of buttons, messages, text and other content in the display interface of software applications or web pages.
[0043] The text resources to be stored obtained by the resource management terminal carry an index identifier.
[0044] For example, the index identifier is used to indicate the text type to which the text resource to be stored belongs.
[0045] For example, if the text resource is a multilingual text resource, the index identifier is used to distinguish the text resources developed for different languages. By referencing different index identifiers, switching between different languages can be achieved.
[0046] It should be noted that, in conjunction with the application scenarios of the above embodiments of this application, since the same text resource in the resource management terminal of this application can be referenced by multiple resource users, and some resource users may have customization requirements for text resources, the text resource to be stored received by the resource management terminal may be a newly created text resource or a text resource modified from an existing text resource, that is, a text resource that meets the customization requirements of the resource user.
[0047] Step S220: Query whether there is an index identifier corresponding to the text resource to be stored in the text resource set. The text resource set is used to store text resources and the index identifiers corresponding to the text resources. The resource types of the stored text resources include master database resources and slave database resources.
[0048] The resource management terminal contains a collection of text resources, which is used to store text resources and their corresponding index identifiers, that is, to store text resources and their corresponding index identifiers together.
[0049] For example, a text resource collection contains Chinese text resources, which correspond to a first index identifier. The Chinese text resources and the first index identifier are stored together, and the Chinese text resources can be retrieved by querying the first index identifier.
[0050] In addition, in this application, the resource types of the text resources already stored in the text resource set include master database resources and slave database resources, and both master database resources and slave database resources correspond to the same index identifier.
[0051] For example, a text resource set contains Chinese text resources, each corresponding to a first index identifier. There are multiple Chinese text resources. One of these resources is selected as the primary database resource, and the others serve as secondary database resources. This application does not limit the selection of the earliest created Chinese text resource or the resource with the largest data volume among the multiple resources.
[0052] The index identifier can be implemented through a multilingual key. The multilingual key is an identifier for different languages. The software uses this key to convert the text into the target language to determine the language used by the software when displaying the text. Typically, the multilingual key definition uses an English string.
[0053] By having both master and slave resources correspond to the same index identifier, and using the index identifier as the management granularity, the same index identifier can be used differently by multiple resource users.
[0054] For example, the primary database resources and the secondary database resources can contain the same content or different content.
[0055] For example, the primary database resource specifies that the text content displayed for control 1 in the display interface is "Main Interface," while the secondary database resource corresponding to the primary database resource specifies that the text content displayed for control 1 in the display interface is "Homepage." Optionally, the secondary database resource can retain only the data content that differs from the primary database resource to avoid wasting storage resources.
[0056] Based on the index identifier carried by the text resource to be stored, query whether the index identifier corresponding to the text resource to be stored exists in the text resource set, so as to determine whether the text resource to be stored is a newly created text resource or a text resource generated after modifying an existing text resource.
[0057] Step S230: If an index identifier corresponding to the text resource to be stored exists in the text resource set, then obtain the master database resource corresponding to the existing index identifier, and associate the text resource to be stored as a slave database resource with the master database resource.
[0058] If an index identifier corresponding to the text resource to be stored exists in the text resource set, it indicates that the text resource to be stored is a text resource generated after modifying an existing text resource. This application obtains the master database resource corresponding to the existing index identifier and associates the text resource to be stored as a slave database resource with the master database resource, thereby preserving the text resource before modification. This avoids the situation where all resource users are affected by the modification of the text resource before modification. Instead, by using the text resource before modification as the master database resource and associating the modified text resource slave database resource with the master database resource, it enables differentiated use among multiple resource users.
[0059] In conjunction with the above embodiments, taking a multilingual text resource as an example, and using an index identifier to indicate the text type to which the text resource to be stored belongs, we will illustrate the following:
[0060] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating a collection of text resources as an exemplary embodiment of this application. Figure 3 As shown, the text resource collection in the resource management terminal stores Chinese text resources, English text resources, German text resources, etc. Different language text resources correspond to different index identifiers; for example, index identifier Key1 corresponds to Chinese text resources. For index identifier Key1, it is associated with text resources a1, a2, and a3. The primary database resource can be determined based on the creation time of the text resources. For example, if the earliest created text resource a1 is designated as the primary database resource, then text resources a2 and a3 are designated as secondary database resources.
[0061] In some implementations, if there is no index identifier corresponding to the text resource to be stored in the text resource set, the text resource to be stored is associated with the index identifier as a primary database resource.
[0062] If the text resource collection does not contain an index identifier corresponding to the text resource to be stored, it indicates that the text resource to be stored is a newly created text resource, and the text resource to be stored is directly associated with the index identifier as the main database resource.
[0063] Specifically, please refer to Figure 4 , Figure 4 A flowchart illustrating a text resource management method as another exemplary embodiment of this application is shown below. Figure 4 As shown:
[0064] Step S410: Obtain the text resource to be stored imported from the resource generation end. The text resource to be stored carries an index identifier Key.
[0065] Step S420: Search the text resource set for the existence of the Key. If it exists, proceed to step S430; otherwise, proceed to step S440.
[0066] Step S430: Use the text resource to be stored as the slave resource corresponding to the Key;
[0067] Step S440: Use the text resource to be stored as the main database resource corresponding to the Key;
[0068] Step S450: Import the text resource collection.
[0069] Step S240: Receive the resource acquisition request sent by the resource user, select the main library resource or the slave library resource from the text resource set according to the preset conditions and return it to the resource user so that the resource user can render and display the main library resource or the slave library resource.
[0070] Among them, the resource acquisition request is used to request text resources. The resource acquisition request can be issued by a software application or webpage running on the resource user end.
[0071] Taking a multilingual text resource as an example, where the index identifier is used to indicate the text type to which the text resource to be stored belongs, the following example illustrates the concept:
[0072] The resource acquisition request is used to request Chinese text resources. By querying the text resource set, the Chinese text resources include the main library resource a1 and the slave library resources a2 and a3. According to preset conditions, any one of the text resources a1, a2 and a3 is selected and returned to the resource user so that the resource user can render and display the returned text.
[0073] For example, if the preset conditions determine that the resource user corresponding to the resource acquisition request is a text resource customization client and its customized text resource is a2, then a2 will be returned to the resource user; if the preset conditions determine that the resource user corresponding to the resource acquisition request is not a text resource customization client, then a1 will be returned to the resource user.
[0074] In some implementations, if the slave resource only stores data content different from the master resource, then before returning the slave resource to the resource user, the slave resource and the master resource need to be merged so that the merged text resource can be returned to the resource user.
[0075] For example, identify the difference data items between the master database resource and the slave database resource, replace the values of the difference data items in the master database resource with the values of the difference data items in the slave database resource, and thus obtain the merged text resource.
[0076] The steps of this application will now be described in further detail:
[0077] In some implementations, the resource acquisition request carries an index identifier; receiving the resource acquisition request sent by the resource user, step S240 involves selecting a master library resource or a slave library resource from the text resource set according to preset conditions and returning it to the resource user so that the resource user can render and display the master library resource or the slave library resource, including:
[0078] Step S241: Select the primary and secondary resources associated with the index identifier corresponding to the resource acquisition request from the text resource set to obtain candidate text resources.
[0079] Both the primary and secondary database resources associated with the index identifier corresponding to the resource acquisition request will be considered as candidate text resources.
[0080] Step S242: Select the target text resource from multiple candidate text resources according to preset conditions.
[0081] The preset conditions are used to select target text resources, which can be either primary or secondary resources.
[0082] For example, the candidate text resources can be matched with the resource requirements of the resource users to obtain the matching degree between each candidate text resource and the resource users. The higher the matching degree, the more the candidate text resource meets the resource requirements of the resource users. Thus, the candidate text resources with a matching degree greater than the preset matching degree threshold are used as the target text resources, or the candidate text resource with the highest matching degree is used as the target text resource.
[0083] Step S243: Return the target text resource to the resource user so that the resource user can render and display the target text resource.
[0084] The target text resource is sent to the resource user. After receiving the target text resource, the resource user renders and displays it.
[0085] For example, the resource acquisition request also carries resource description information; selecting the target text resource from the candidate text resources according to preset conditions includes: filtering multiple candidate text resources based on the resource description information to obtain the target text resource.
[0086] Among them, resource description information is used to characterize the resource requirements of the resource user.
[0087] Based on the resource description information, candidate text resources that meet the resource requirements of the resource user are identified, and these candidate text resources are used as the target text resources.
[0088] For example, the resource description information is the description information of the slave library resource; based on the resource description information, multiple candidate text resources are filtered to obtain the target text resource, including: detecting whether there is a slave library resource among the multiple candidate text resources that matches the slave library resource description information; if there is a slave library resource that matches the slave library resource description information, the matching slave library resource is used as the target text resource; if there is no slave library resource that matches the slave library resource description information, the master library resource among the multiple candidate text resources is used as the target text resource.
[0089] The description information of the slave resource includes, but is not limited to, the name of the slave resource and the creation time of the slave resource.
[0090] Understandably, if the resource acquisition request sent by the resource user carries the description information of the slave resource, it indicates that the resource user is a text resource customization client and needs to return its customized slave resource; if the resource acquisition request sent by the resource user does not carry the description information of the slave resource, it indicates that the resource user is not a text resource customization client and can directly return the general master resource.
[0091] The system checks whether there is a slave resource among multiple candidate text resources that matches the slave resource description information. If there is a slave resource that matches the slave resource description information, the matching slave resource is used as the target text resource. If there is no slave resource that matches the slave resource description information, the master resource among the multiple candidate text resources is used as the target text resource.
[0092] Specifically, please refer to Figure 5 , Figure 5 A flowchart illustrating the determination of a target text resource, as shown in an exemplary embodiment of this application, is as follows: Figure 5 As shown:
[0093] Step S510: Receive a resource acquisition request sent by the resource user, which carries an index identifier Key and a description of the slave database resource;
[0094] Step S520: Determine whether the index identifier Key exists in the text resource set. If it exists, proceed to step S530; otherwise, proceed to step S560.
[0095] Step S530: Determine whether there is a slave resource in the slave resource corresponding to the index identifier Key that matches the slave resource description information. If it exists, proceed to step S540; otherwise, proceed to step S550.
[0096] Step S540: Use the matched library resource as the target text resource;
[0097] Step S550: Use the main database resource corresponding to the index identifier Key as the target text resource;
[0098] Step S560: The target text resource is empty;
[0099] Step S570: Send the target text resource to the resource user terminal so that the software application or webpage on the resource user terminal can render and display the returned target text resource.
[0100] In other embodiments, the text resources correspond to an associated identifier list, which is used to store the identifier information of the associated resource users corresponding to the text resources; step S240 selects the target text resources from the candidate text resources according to preset conditions, including: obtaining the identifier information corresponding to the resource users, and obtaining the associated identifier list corresponding to each candidate text resource; detecting whether there is identifier information corresponding to the resource users in each associated identifier list; and taking the candidate text resources corresponding to the associated identifier list with identifier information corresponding to the resource users as the target text resources.
[0101] The identification information corresponding to the resource user includes, but is not limited to, the name and version information of the software application or webpage.
[0102] A list of associated identifiers for text resources, which stores the identifier information of the associated resource users corresponding to the text resources.
[0103] For example, a resource retrieval request carries an index identifier Key1. Using Key1, a query from the text resource set reveals that Key1 is associated with text resources a1, a2, and a3. Text resource a1 is the primary resource, while text resources a2 and a3 are secondary resources. Each of text resources a1, a2, and a3 corresponds to an associated identifier list. The system checks whether the identifier information corresponding to the resource user exists in these associated identifier lists. If the check indicates that the identifier information corresponding to the resource user exists in the associated identifier list of secondary resource a2, then secondary resource a2 is returned to the resource user as the target text resource.
[0104] In some implementations, if the associated identifier lists of both the master resource and the slave resource contain identifier information corresponding to the resource user, the slave resource will be returned to the resource user as the target text resource. For example, if the associated identifier lists of both the master resource a1 and the slave resource a2 contain identifier information corresponding to the resource user, the slave resource a2 will be returned to the resource user as the target text resource.
[0105] Furthermore, if no identifier information corresponding to the resource user is found in each of the associated identifier lists, then the main library resource among the multiple candidate text resources will be used as the target text resource.
[0106] The text resource management method provided in this application provides text resources to at least two resource users through a resource management terminal, thereby achieving unified management of text resources across multiple resource users. It involves: acquiring text resources to be stored, each carrying an index identifier; querying whether the index identifier corresponding to the text resource to be stored exists in the text resource set; recognizing that the resource types of the text resources already stored in the set include master and slave resources; if the index identifier corresponding to the text resource to be stored exists in the text resource set, acquiring the master resource corresponding to the existing index identifier and associating the text resource to be stored as a slave resource with the master resource; receiving resource acquisition requests from resource users and selecting either a master or slave resource from the text resource set according to preset conditions and returning it to the resource user. This hierarchical storage method of master and slave resources for text resources, while enabling multiple resource users to reference a single text resource and reducing the workload of text development, ensures differentiated use for multiple resource users, avoids the impact of changes to text resources on other resource users, and improves the efficiency and stability of multi-language use.
[0107] Figure 6 This is a block diagram illustrating a text resource management device in an exemplary embodiment of this application. Deployed at a resource management terminal, the resource management terminal provides text resources to at least two resource users. These text resources are used for rendering and displaying text content in a display interface. Figure 6 As shown, the exemplary text resource management device 600 includes: a resource acquisition module 610, a query module 620, a storage module 630, and an acquisition request processing module 640. Specifically:
[0108] The resource acquisition module 610 is used to acquire text resources to be stored, and the text resources to be stored carry an index identifier.
[0109] The query module 620 is used to query whether there is an index identifier corresponding to the text resource to be stored in the text resource set. The text resource set is used to store text resources and the index identifiers corresponding to the text resources. The resource types of the stored text resources include master database resources and slave database resources.
[0110] The storage module 630 is used to obtain the master database resource corresponding to the existing index identifier if there is an index identifier for the text resource to be stored in the text resource set, and associate the text resource to be stored as a slave database resource with the master database resource.
[0111] The request processing module 640 is used to receive resource acquisition requests sent by the resource user, select master or slave resources from the text resource set according to preset conditions, and return them to the resource user so that the resource user can render and display the master or slave resources.
[0112] In the above-described exemplary text resource management device, by using a hierarchical storage method of master and slave resources for text resources, a single text resource can be referenced by multiple resource users, reducing the workload of text development. This ensures differentiated use for multiple resource users, avoids the impact of changes to text resources on other resource users, and improves the efficiency and stability of multilingual use.
[0113] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device of this application. The electronic device 700 includes a memory 701 and a processor 702. The processor 702 is used to execute program instructions stored in the memory 701 to implement the steps in any of the above-described text resource management method embodiments. In a specific implementation scenario, the electronic device 700 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 700 may also include mobile devices such as laptops and tablets, which are not limited here.
[0114] Specifically, processor 702 controls itself and memory 701 to implement the steps in any of the above-described text resource management method embodiments. Processor 702 can also be referred to as a Central Processing Unit (CPU). Processor 702 may be an integrated circuit chip with signal processing capabilities. Processor 702 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 702 can be implemented using integrated circuit chips.
[0115] Please see Figure 8 , Figure 8 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 800 stores program instructions 810 that can be executed by a processor. The program instructions 810 are used to implement the steps in any of the above-described text resource management method embodiments.
[0116] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0117] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0119] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A text resource management method, characterized in that, An application is made in a resource management terminal, which provides text resources to at least two resource users. These text resources are used to render and display text content in a display interface. The text resources are multilingual. The method includes: Obtain the text resource to be stored, wherein the text resource carries an index identifier; The system queries whether the text resource set contains an index identifier corresponding to the text resource to be stored. The text resource set is used to store text resources and the index identifiers corresponding to the text resources. The resource types of the stored text resources include master database resources and slave database resources. Among multiple text resources corresponding to the same index identifier, the text resource with the largest data volume is used as the master database resource, and the other text resources are used as slave database resources. The slave database resources only retain data content that is different from the master database resources. If an index identifier corresponding to the text resource to be stored exists in the text resource set, then the existing master database resource corresponding to the index identifier is obtained, and the text resource to be stored is associated with the master database resource as a slave database resource. Receive a resource acquisition request sent by the resource user, wherein the resource acquisition request carries an index identifier; From the text resource set, select the primary and secondary resources associated with the index identifier corresponding to the resource acquisition request to obtain candidate text resources; Select the target text resource from multiple candidate text resources according to preset conditions; If the target text resource is a slave resource, the target text resource and the corresponding master resource are merged, and the merged text resource is returned to the resource user so that the resource user can render and display the merged text resource.
2. The method according to claim 1, characterized in that, The resource acquisition request also carries resource description information; the step of selecting the target text resource from the candidate text resources according to preset conditions includes: Based on the resource description information, the multiple candidate text resources are filtered to obtain the target text resource.
3. The method according to claim 2, characterized in that, The resource description information is the resource description information from the database. The step of filtering the multiple candidate text resources based on the resource description information to obtain the target text resource includes: Detect whether there is a slave resource among the multiple candidate text resources that matches the slave resource description information; If a slave resource exists that matches the slave resource description information, then the matching slave resource is used as the target text resource. If no slave resource matches the slave resource description information, then the master resource among the multiple candidate text resources is taken as the target text resource.
4. The method according to claim 1, characterized in that, The text resource corresponds to an associated identifier list, which stores the identifier information of the associated resource users corresponding to the text resource; the step of selecting the target text resource from the candidate text resources according to preset conditions includes: Obtain the identification information corresponding to the resource user terminal, and obtain the associated identification list corresponding to each candidate text resource; Check whether the resource user's corresponding identifier information exists in each of the associated identifier lists; The candidate text resources corresponding to the associated identifier list containing the identifier information of the resource user are used as the target text resources.
5. The method according to claim 4, characterized in that, The step of using candidate text resources corresponding to the associated identifier list containing the identifier information of the resource user as target text resources includes: If no identifier information corresponding to the resource user is found in any of the associated identifier lists, then the main library resource among the multiple candidate text resources will be used as the target text resource.
6. The method according to claim 1, characterized in that, The method further includes: If the text resource set does not contain an index identifier corresponding to the text resource to be stored, then the text resource to be stored will be associated with the index identifier as a primary database resource.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the processor being configured to execute program instructions stored in the memory to implement the steps of the method as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that can be executed by a processor to implement the steps of the method as described in any one of claims 1-6.