Cboth language package updating method, device and equipment and readable storage medium

Through the international language pack synchronization server, the copy language packs of multiple storage channels are merged and updated periodically by the business line server, which solves the problem of slow language pack update speed and realizes efficient copy language pack update.

CN120406987APending Publication Date: 2025-08-01SUZHOU WANDIANZHANG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510555158.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the prior art, language pack copy update speed is slow, and projects need to be recompiled and deployed, resulting in inefficiency.

Method used

Through the international language pack synchronization server, the copy language pack is obtained from multiple storage channels and merged. The business line server synchronizes the latest copy language packs and updates according to the preset cycle, reducing system coupling.

Benefits of technology

It realizes timely updates of copywriting language packs, improves update efficiency, and does not require recompilation and restart, reducing system coupling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406987A_ABST
    Figure CN120406987A_ABST
Patent Text Reader

Abstract

The invention discloses a copywriting language package updating method, device and equipment and a readable storage medium, and is applied to the technical field of data synchronization, and the method comprises the steps that an internationalization language package synchronization server obtains copywriting language packages corresponding to storage channels from a preset number of storage channels, combines the copywriting language packages corresponding to the storage channels, and stores the combined copywriting language packages in the storage channels; obtaining a copywriting language package file directory; the preset number is greater than 1; and the service line server synchronizes the latest target copywriting language package in the copywriting language package file directory from the internationalized language package synchronization server according to a preset period, and compares and updates the latest target copywriting language package with the copywriting language package locally corresponding to the service line to obtain the updated target copywriting language package. According to the invention, the business line server is utilized to synchronize the latest target copywriting language package from the internationalized language package synchronization server according to the preset period, and the local copywriting language package of the business line is updated, so that the copywriting language package can be updated in time, and the efficiency of updating the copywriting language package is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data synchronization, and particularly to a method, device, equipment and readable storage medium for updating a copywriting language pack. Background Art

[0002] The copywriting language pack refers to the data generated by the code. For example, when a user logs in, a message "Login successful" is fed back as a copywriting reminder. Currently, each time the copywriting language pack is updated, the project needs to be recompiled and deployed, resulting in a relatively slow update speed of the language pack.

[0003] Therefore, how to improve the update efficiency of the copywriting language pack is a technical problem that needs to be urgently solved by those skilled in the art. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and readable storage medium for updating a copywriting language pack, which solves the technical problem of low update efficiency of the copywriting language pack in the prior art.

[0005] To solve the above technical problem, the present invention provides a method for updating a copywriting language pack, including:

[0006] The internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1;

[0007] The business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalized language pack synchronization server at a preset period, and compares and updates it with the copywriting language pack corresponding to the local business line to obtain the updated target copywriting language pack.

[0008] Optionally, the internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory, including:

[0009] The internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from 3 storage channels, and obtains the copywriting language pack corresponding to the static resource file, the copywriting language pack corresponding to the object storage service, and the copywriting language pack corresponding to the database.

[0010] Optionally, the internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory, including:

[0011] Merge the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain the directory of the copywriting language pack file.

[0012] Optionally, merging the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain the directory of the copywriting language pack file includes:

[0013] When the copywriting language packs corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, merge the copywriting language packs based on the priority of each storage channel to obtain the directory of the copywriting language pack file.

[0014] Optionally, before merging the copywriting language packs based on the priority of each storage channel to obtain the directory of the copywriting language pack file when the copywriting language packs corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, it further includes:

[0015] Determine the priority of each storage channel based on the preferences of the current module; wherein, the preferences of the module include business characteristics, update frequency, and security requirements.

[0016] Optionally, the business line server synchronizes the latest target copywriting language pack in the directory of the copywriting language pack file from the internationalization language pack synchronization server at a preset period, and compares and updates it with the copywriting language pack corresponding to the local business line to obtain the updated target copywriting language pack, including:

[0017] The business line server receives a user request, and parses the language environment of the user request to obtain language environment information;

[0018] The business line server obtains the latest target copywriting language pack corresponding to the language environment information from the directory of the copywriting language pack file based on the language environment information, and compares and updates it with the copywriting language pack corresponding to the local business line to obtain the updated target copywriting language pack.

[0019] Optionally, it further includes:

[0020] When the business line server receives a version switching request, determine the target version corresponding to the version switching request, and obtain the language pack of the target version from the internationalization language pack synchronization server; wherein, the internationalization language pack synchronization server stores each version of the copywriting language pack.

[0021] An embodiment of the present invention further provides a copywriting language pack update device, including:

[0022] A merging module, which is used for an internationalization language pack synchronization server of a language pack copywriting to obtain copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merge the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1;

[0023] A synchronization and update module, which is used for a business line server to synchronize the latest target copywriting language pack in the copywriting language pack file directory from the internationalization language pack synchronization server at a preset period, and compare and update it with the copywriting language pack corresponding to the local business line to obtain an updated target copywriting language pack.

[0024] An embodiment of the present invention further provides a copywriting language pack update device, including:

[0025] A memory, which is used for storing a computer program;

[0026] A processor, which is used for executing the computer program to implement the steps of the above copywriting language pack update method.

[0027] An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above copywriting language pack update method are implemented.

[0028] An embodiment of the present invention further provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the above copywriting language pack update method are implemented.

[0029] It can be seen that the present invention obtains copywriting language packs corresponding to each storage channel from a preset number of storage channels through an internationalization language pack synchronization server, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1; the business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalization language pack synchronization server at a preset period, and compares and updates it with the copywriting language pack corresponding to the local business line to obtain an updated target copywriting language pack. The beneficial effects of the present invention are as follows: compared with the low local update efficiency of the current copywriting language pack, the present application updates the local copywriting language pack with the latest copywriting language pack obtained from the internationalization language pack synchronization server by the server at a preset period, can update the copywriting language pack in time, improves the update efficiency of the copywriting language pack, and can load the latest copywriting language pack without recompiling and restarting. Moreover, since the merging and update of the copywriting language pack are responsible by different services, the system coupling can be reduced.

[0030] In addition, the present invention also provides a device, equipment, and readable storage medium for updating a copywriting language pack, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0032] Figure 1 It is a flowchart of a method for updating a copywriting language pack provided by an embodiment of the present invention;

[0033] Figure 2 It is a flow example diagram of a method for updating a copywriting language pack provided by an embodiment of the present invention;

[0034] Figure 3 It is a structural schematic diagram of a device for updating a copywriting language pack provided by an embodiment of the present invention;

[0035] Figure 4 It is a structural schematic diagram of a device for updating a copywriting language pack provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0037] Please refer to Figure 1 , Figure 1 It is a flowchart of a method for updating a copywriting language pack provided by an embodiment of the present invention. The method may include:

[0038] S101, the internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1.

[0039] The internationalized language pack synchronization server in this embodiment is a server defined by the present invention according to tags. This server is used to promptly merge the copywriting language packs and update the versions of the copywriting language packs. It can also perform verification to ensure that the data is not tampered with during the transmission process. This embodiment does not limit the specific storage channels. For example, the storage channel in this embodiment can be JAR (Java Archive, built-in file). JAR is a file package based on the ZIP format, which is used to package Java class files, resource files, and metadata into a single file for easy distribution or deployment. The storage channel in this embodiment can also be or OSS (Object Storage Service, object storage). JAR is a cloud storage service that stores unstructured data (such as documents, pictures, videos) through a flattened structure (instead of the traditional file hierarchy). The storage channel in this embodiment can also be DB (Database), configuration center, third-party platform, etc. DB is used to store a collection of structured data and is stored, queried, and managed through a database management system. The reason for merging the copywriting language packs in each storage channel in this embodiment is that the same copywriting may exist repeatedly in different language packs, and through merging, the copywriting language packs can be well managed. This embodiment does not limit the specific method of merging. For example, this embodiment can merge the copywriting language packs based on modules; or this embodiment can also merge the copywriting language packs based on modules and deployment environments, or this embodiment can also merge the copywriting language packs based on modules, deployment environments, and language environments; or this embodiment can also merge the copywriting language packs based on module types and language environments. The copywriting language pack directory in this embodiment is a directory that can manage copywriting language packs of various versions and types. Therefore, because the present invention uses the copywriting language pack file directory, it is convenient to roll back and switch language packs of different versions (any language pack of a historical release will have a snapshot).

[0040] It should be further noted that, based on any of the above embodiments, in order to improve the accuracy of merging, the above internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory, which may include: the internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from 3 storage channels, and obtains the copywriting language packs corresponding to the static resource file, the object storage service, and the database. The preset number in this embodiment is 3, and the 3 storage channels in this embodiment are the static resource file (JAR), the object storage service (OSS), and the database (DB). Compared with the current method of obtaining the copywriting language pack from a single storage channel, which results in a single and incomplete copywriting language pack and cannot take into account integrity, the present invention realizes the dynamic integration and distribution of the language pack through the collaborative work of three types of heterogeneous storage channels, namely the static resource file, the object storage service, and the database.

[0041] It should be further noted that, based on any of the above embodiments, in order to achieve refined merging, the above internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory, which may include: merging the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain a copywriting language pack file directory. The module type in this embodiment refers to an independent unit divided by function or business logic in a software system, such as a user management module, a payment module, a product details module, etc.; the deployment environment in this embodiment refers to different stage configurations for an application program to run, usually including environments such as development (Dev), testing (Test), pre-release (Staging), production (Prod), etc.; the language environment in this embodiment refers to the regional language identifier in multi-language support, which can be composed of a language code (such as zh) and a region code (such as CN), such as zh_CN (Simplified Chinese), en_US (American English). The merging of the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment in this embodiment means that the copywriting language packs of all channels are grouped by module type, and the deployment environment under the module type grouping, and further the environment language under the deployment environment, where various copywriting contents can also be included under the environment language. For example, ase_zh_CN.properties: (file content in Chinese environment): NVRDiskInfoExcel.diskNumPartList = Disk position details, NVRDiskInfoExcel.diskNumList.indexNum = Disk position number, NVRDiskInfoExcel.diskNumList.totalSpace = Total capacity (unit: T), NVRDiskInfoExcel.diskNumList.useSpace = Used capacity (unit: T), NVRDiskInfoExcel.diskNumList.freeSpace = Remaining capacity (unit: T). Through the module type, deployment environment, and language environment, this embodiment can obtain a copywriting language pack file directory composed of the copywriting language packs of each storage channel, so that the copywriting required for each module can be accurately obtained based on this directory. Since the module type, deployment environment, and language environment are involved in the merging, the accuracy of the copywriting language pack file directory can be improved. It can be understood that the advantages of merging based on the above three dimensions may include: (1) Modular maintenance and decoupling: Modules can independently maintain the language packs of their respective modules, avoiding global file conflicts. Example: When modifying the transaction copywriting in the transaction module, there is no need to worry about affecting the translation of the user module. (2) Environment adaptation and isolation to ensure that each environment uses a matching copywriting version and avoid the leakage of test content to the production environment.(3)Fine-grained multilingual management, supporting differential configuration for different regions under the same language (such as zh_CN and zh_TW). Example: zh_CN: "Network anomaly", zh_TW: "Network connection anomaly". It should be further noted that during the merging process, dynamic priority control can also be achieved, enabling flexible override through source priorities (such as DB > OSS > JAR) to meet emergency repair requirements. Example: The database can repair translation errors in real time without waiting for code release. Conflict resolution and consistency guarantee, advantage: Structured merging rules eliminate multi-source conflicts and ensure the uniqueness of the final version.

[0042] It should be further noted that based on any of the above embodiments, the merging of the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain the copywriting language pack file directory may include: when the copywriting language packs corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, the copywriting language packs are merged based on the priority of each storage channel to obtain the copywriting language pack file directory. In this embodiment, the priority of each storage channel is considered during the merging process. This priority can be determined according to requirements or other rules. When the module type, deployment environment, and language environment of the copywriting language packs corresponding to each current storage channel are the same, the copywriting language pack of the storage channel with the highest priority can be used as the final language pack. It should be noted that when the language environment is the same and the subjects targeted by the copywriting content in the language environment are different, the copywriting of each storage channel can be retained. When the subjects targeted by the copywriting content are the same, only the copywriting of the storage channel with a higher priority can be retained.

[0043] It should be further noted that, in order to improve the accuracy of priority determination, before merging the copywriting language packs based on the priorities of each storage channel to obtain the copywriting language pack file directory when the copywriting language packs corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, it may further include: determining the priority of each storage channel based on the preferences of the current module; among them, the preferences of the module include business characteristics, update frequency, and security requirements. The business characteristics in this embodiment refer to the core functional requirements of the business, such as real-time performance, interaction complexity, etc. Generally, high real-time performance can utilize a database (DB), and low real-time performance can utilize a Java Archive (JAR); the update frequency in this embodiment refers to the frequency of copywriting changes. Generally, high-frequency changes can utilize an Object Storage Service (OSS), and low-frequency changes can utilize a JAR; the security requirements in this embodiment refer to the sensitivity to copywriting tampering (such as financial terms, error messages). Generally, high security can utilize a DB (permission control), and low security can adopt an OSS. It can be understood that the priority can be determined based on the preference weights of each module, and the module preference dimensions and weight assignments are as follows: for business characteristics, 3 points: it needs to take effect in real time. 2 points: hour-level delay is allowed. 1 point: no real-time requirement. For the update frequency weight determination, 3 points: updated at the minute level (such as event copywriting). 2 points: updated daily. 1 point: updated quarterly. The security requirement scoring standard is 3 points: involving funds or privacy. 2 points: ordinary user data. 1 point: public content. This embodiment improves the accuracy of copywriting language pack merging and the user experience by giving the specific process of dividing priorities.

[0044] For ease of understanding, the following is an example of a copywriting language pack file directory provided by an embodiment of the present invention:

[0045] jar:

[0046] -i18n

[0047] -device (module name)

[0048] -base (deployment environment)

[0049] -base_zh_CN.properties

[0050] -base_en_US.properties

[0051] -dashu

[0052] -dashu_zh_CN.properties

[0053] -dashu_en_US.properties

[0054] -msg

[0055] -base_zh_CN.properties

[0056] -base_en_US.properties

[0057] The file content is a line-by-line key-value pair. Example:

[0058] base_zh_CN.properties:

[0059] NVRDiskInfoExcel.diskNumPartList = Disk position details

[0060] NVRDiskInfoExcel.diskNumList.indexNum = Disk position number

[0061] NVRDiskInfoExcel.diskNumList.totalSpace = Total capacity (unit: T)

[0062] NVRDiskInfoExcel.diskNumList.useSpace = Used capacity (unit: T)

[0063] NVRDiskInfoExcel.diskNumList.freeSpace = Remaining capacity (unit: T)

[0064] dashu_en_US.properties:

[0065] DeviceVideoRecordReport.dishStatus = Hard drive status

[0066] DeviceVideoRecordReport.dishCapacity = Capacity (total / available)

[0067] DeviceVideoRecordReport.onlineStatus = Device status

[0068] DeviceVideoRecordReport.ipcName = Channel name

[0069] OSS: OSS is actually a network file address, such as http: / / ovopark.com / i18n / device.zip. The directory structure in this file is the same as that of a jar, but it is stored on a cloud service provider

[0070] DB: The table structure is as follows: CREATE TABLE `tb_i18_data` ( `key` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Internationalization KEY', `module` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Module', `env` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Deployment environment', `zhCN` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Chinese copywriting', `enUS` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'English copywriting', PRIMARY KEY(`key`))

[0071] ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; Example (content stored in the table structure): key module env zhCN enUS device.name device base Device name device name device.mac device base Device MAC device mac.

[0072] The reason for combining this embodiment into the form of a file directory is that considering the different forms of each storage channel, the file directory can be unified to the granularity of files.

[0073] S102. The business line server synchronizes the latest target copywriting language package in the copywriting language package file directory from the internationalization language package synchronization server at a preset cycle, and compares and updates it with the corresponding local copywriting language package of the business line to obtain the updated target copywriting language package.

[0074] This embodiment does not limit the specific preset period, which can be determined according to requirements. The preset period in this embodiment can be 1 second; or the preset period in this embodiment can be 1 minute. The business line server in this embodiment is an independently operated functional module or product line, and it needs to rely on the internationalization language pack synchronization server to provide multi-language support. Its core behaviors can include: obtaining the latest copywriting language pack from the internationalization language pack synchronization server through a polling or listening mechanism, storing the currently used language pack version and check value for version comparison. After detecting a new version, it automatically downloads and replaces the local language pack without restarting the service. In this embodiment, the service of the business line can load the latest language pack without recompiling or restarting, and the business line can strip the copywriting language pack out of the project. The present invention can be a multi-language synchronization solution for enterprise applications using Java Spring (a lightweight open-source framework for building enterprise-level applications).

[0075] It should be further noted that, based on any of the above embodiments, in order to improve the accuracy of the update, the above business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalization language pack synchronization server according to the preset period, and compares and updates it with the corresponding copywriting language pack locally on the business line to obtain the updated target copywriting language pack, which may include: the business line server receives a user request and parses the language environment of the user request to obtain language environment information; the business line server obtains the latest target copywriting language pack corresponding to the language environment information from the copywriting language pack file directory based on the language environment information, and compares and updates it with the corresponding copywriting language pack locally on the business line to obtain the updated target copywriting language pack. In this embodiment, when performing the update, it will directly locate to the language environment information in the directory to obtain the latest target copywriting language pack corresponding to the current language environment. When performing the comparison and update in this embodiment, it can be compared based on the version number, or it can also be updated based on the hash. The business line server ensures the real-time nature and consistency of the multi-language copywriting through a combination of periodic synchronization and real-time request-driven update.

[0076] It should be further noted that, based on any of the above embodiments, in order to improve the user experience, the above copywriting language pack synchronization method may further include: determining the target version corresponding to the version switching request, and obtaining the language pack of the target version from the internationalization language pack synchronization server; wherein, the internationalization language pack synchronization server stores each version of the copywriting language pack. This embodiment can implement the switching of the versions of the copywriting language pack and improve the user experience.

[0077] A method for updating a copywriting language pack provided by an embodiment of the present invention may include: S101, an internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1; S102, a business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalized language pack synchronization server at a preset period, and compares and updates it with the corresponding copywriting language pack locally to obtain an updated target copywriting language pack. Compared with the low local update efficiency of the current copywriting language pack, the present application can update the local copywriting language pack in a timely manner by using the copywriting language version obtained from the internationalized language pack synchronization server by the server at a preset period, improving the update efficiency of the copywriting language pack, and can load the latest copywriting language pack in the case of recompilation and restart. Moreover, since the merging and updating of the copywriting language pack are responsible for different services, the system coupling can be reduced.

[0078] For the convenience of understanding the present invention, please specifically refer to Figure 2 , Figure 2 which is a flowchart example of a method for updating a copywriting language pack provided by an embodiment of the present invention, and may specifically include:

[0079] S201, after the internationalized language pack synchronization server receives the copywriting language pack of a module, it unifies the forms of the copywriting language packs of each storage channel into file forms.

[0080] S202, the internationalized language pack synchronization server merges the copywriting language packs in file form of each storage channel to obtain a copywriting language pack file directory, and determines the latest copywriting language pack in the current copywriting language pack file directory.

[0081] The MD5 in this embodiment is a hashing algorithm. The process of loading a copywriting language pack in this embodiment may include: loading the original data of the copywriting language pack from each storage channel, and then unpacking it internally; using java messageformat (a core class for processing string formatting with placeholders) to verify whether the data is legal; storing the new copywriting language pack as a temporary file, comparing and merging this temporary file with the previous version file; generating a file directory of the latest version of the copywriting language pack.

[0082] For the convenience of understanding, the following JAR file in file form is given in this embodiment:

[0083] jar:

[0084] -i18n

[0085] -device (Module Name)

[0086] -base (Deployment Environment)

[0087] -base_zh_CN.properties

[0088] -base_en_US.properties

[0089] -dashu

[0090] -dashu_zh_CN.properties

[0091] -dashu_en_US.properties

[0092] -msg

[0093] -base_zh_CN.properties

[0094] -base_en_US.properties

[0095] The file content is a line-by-line key-value pair. Example:

[0096] base_zh_CN.properties:

[0097] NVRDiskInfoExcel.diskNumPartList = Disk position details

[0098] NVRDiskInfoExcel.diskNumList.indexNum = Disk position number

[0099] NVRDiskInfoExcel.diskNumList.totalSpace = Total capacity (unit: T)

[0100] NVRDiskInfoExcel.diskNumList.useSpace = Used capacity (unit: T)

[0101] NVRDiskInfoExcel.diskNumList.freeSpace = Remaining capacity (unit: T)

[0102] dashu_en_US.properties:

[0103] DeviceVideoRecordReport.dishStatus = Hard drive status

[0104] DeviceVideoRecordReport.dishCapacity = Capacity (total / available)

[0105] DeviceVideoRecordReport.onlineStatus = Device status

[0106] DeviceVideoRecordReport.ipcName = Channel name。

[0107] The file form of OSS given in this embodiment is as follows: OSS is actually a network file address, such as http: / / ovopark.com / i18n / device.zip. The directory structure in this file is the same as that of a jar, but it is stored on the cloud service provider.

[0108] The file form of DB given in this embodiment is as follows: The table structure is as follows:

[0109] CREATE TABLE `tb_i18_data` (

[0110] `key` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Internationalization KEY',

[0111] `module` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Module',

[0112] `env` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Deployment environment',

[0113] `zhCN` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Chinese copywriting',

[0114] `enUS` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'English copywriting',

[0115] PRIMARY KEY (`key`)

[0116] ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

[0117] Example: The content stored in the table structure can include key module, env, zhCN, enUS, device.name, device, base, device name "device name", device.mac, device, base, device mac "device mac".

[0118] When merging this embodiment, select the language environment to be published, and then generate a publishing task on the internationalized language pack synchronization server (hereinafter referred to as the main service). The main service obtains the language packs for this environment from the DB, OSS, and JAR respectively. 1) For the DB, use the select query statement to obtain all the data in a specific environment (select from tb_i18_data where env = xx), group these data by different modules, generate different files, and form the following data structure:

[0119] 18n.device.base

[0120] -base_zh_CN.properties

[0121] -base_en_US.properties

[0122] 18n.msg.base

[0123] -base_zh_CN.properties

[0124] -base_en_US.properties

[0125] 2) For the OSS, directly use the HTTP client to pull the file from the remote address, then unzip the zip file, and also generate the following data structure in memory:

[0126] 18n.device.base

[0127] -base_zh_CN.properties

[0128] -base_en_US.properties

[0129] 18n.msg.base

[0130] -base_zh_CN.properties

[0131] -base_en_US.properties

[0132] 3) JAR, directly read the JAR file in the local JVM, and generate the following data structure in the memory:

[0133] 18n.device.base

[0134] -base_zh_CN.properties

[0135] -base_en_US.properties

[0136] 18n.msg.base

[0137] -base_zh_CN.properties

[0138] -base_en_US.properties

[0139] When merging, this embodiment can prioritize DB, OSS, and JAR files from high to low based on certain merging rules. Each line of content in these properties files is read separately according to the priority of DB, OSS, and JAR, and the one with the highest priority is selected. For example, if the key device.name appears in a file generated by DB and a file generated by OSS, the DB copy is used as the final copy. The final copy language package file directory is generated according to the same directory structure, except that the contents of these files are the final merged content. These copy language package file directories are then stored on the local disk.

[0140] -18n

[0141] -device (module)

[0142] -v20250331 (version)

[0143] -base (environment)

[0144] -base_zh_CN.properties

[0145] -base_en_US.properties

[0146] -v20250402

[0147] -base

[0148] -base_zh_CN.properties

[0149] -base_en_US.properties

[0150] -msg

[0151] -v20250331

[0152] -base

[0153] -base_zh_CN.properties

[0154] -base_en_US.properties

[0155] -v20250402

[0156] -base

[0157] -base_zh_CN.properties

[0158] -base_en_US.properties

[0159] In S203, according to a preset period, the business line server updates the local copywriting language pack by comparing the MD5 of the local copywriting language pack of the business line with the MD5 of the latest copywriting language pack.

[0160] It should be noted that the data structure (file form) of the standardized (unified) copywriting language pack supports multiple environments; under the switching of multi-language environments (the client defines the language pack through configuration, and the client will update when the subsequent language pack is updated, but it is dynamically refreshed in the background), the business side can dynamically load the language pack without recompiling and redeploying.

[0161] In S204, when the internationalized language pack synchronization server receives a version switching request, based on the target version corresponding to the version switching request, it takes the target version as the currently available version and assigns an activation identifier to the currently available version as the currently latest copywriting language pack.

[0162] In S205, the business line server updates the local copywriting language pack based on the currently latest copywriting language pack according to the version switching request.

[0163] When performing version switching in this embodiment, the internationalized language pack synchronization server can list multiple versions that a certain module can use in the current environment, and then can select a certain version as the currently available version. In this way, this specific version has an activation flag, and only one version of the same module can be activated, and by default it is the version generated last. The internationalized language pack synchronization server only synchronizes the currently activated version. This embodiment can also perform rendering. When the user switches the language on the front-end WEB page, the current client language environment, such as the identifier of en_US, will be carried in an HTTP request. When the business line receives this request, it parses the language environment identifier, and then the message source will obtain the copywriting of a specific language environment from a specific base_xxxx.properties file according to this language identifier. For example, if the business JAVA code wants to obtain a specific key, such as device.name, it can find the English copywriting "device name" in the base_en_US.properties file.

[0164] After obtaining the copywriting language packs of each storage channel in the embodiment of the present invention, they are merged. For example, version comparison operations are performed. After the merger is completed, all the copywriting information of the copywriting language packs of each storage channel is included, and the latest snapshot of the highest version can be synchronized to the business line server accessing the synchronization service according to the internationalized language pack synchronization server; each version of the language pack has a unique MD5 value. The business line pulls the internationalized language pack synchronization service every 5 seconds, and the synchronization service compares whether the MD5 value of the latest snapshot version language pack is equal to the MD5 value of the local version language pack. If not, it obtains the latest version of the internationalized language pack.

[0165] The copywriting language pack update device provided by the embodiment of the present invention will be introduced below. The copywriting language pack update device described below can be correspondingly referred to the copywriting language pack update method described above.

[0166] Specifically, please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a copywriting language pack update device provided by the embodiment of the present invention, and may include:

[0167] A merging module 100 is used to obtain the copywriting language packs corresponding to each storage channel from a preset number of storage channels by the internationalized language pack synchronization server of the language pack copywriting, and merge the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1;

[0168] The synchronization and update module 200 is used for the business line server to synchronize the latest target copywriting language package in the copywriting language package file directory from the internationalization language package synchronization server at a preset period, and compare and update it with the corresponding copywriting language package locally in the business line to obtain the updated target copywriting language package.

[0169] Further, based on any of the above embodiments, the merging module 100 may include:

[0170] Each storage channel copywriting language package acquisition unit is used for the internationalization language package synchronization server to obtain the copywriting language packages corresponding to each storage channel from 3 storage channels, and obtain the copywriting language package corresponding to the static resource file, the copywriting language package corresponding to the object storage service, and the copywriting language package corresponding to the database.

[0171] Further, based on any of the above embodiments, the merging module 100 may include:

[0172] The merging unit is used to merge the copywriting language packages corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain the copywriting language package file directory.

[0173] Further, based on any of the above embodiments, the merging unit may include:

[0174] The priority-based merging unit is used to, when the copywriting language packages corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, merge the copywriting language packages based on the priority of each storage channel to obtain the copywriting language package file directory.

[0175] Further, based on any of the above embodiments, the above copywriting language package updating device may further include:

[0176] The priority determination module is used to determine the priority of each storage channel based on the preference of the current module; wherein, the preference of the module includes business characteristics, update frequency, and security requirements.

[0177] Further, based on any of the above embodiments, the above synchronization and update module 200 may include:

[0178] The language environment information determination unit is used for the business line server to receive a user request and parse the language environment of the user request to obtain language environment information;

[0179] The synchronization and update unit is used for the business line server to obtain the latest target copywriting language package corresponding to the language environment information from the copywriting language package file directory based on the language environment information, and compare and update it with the corresponding copywriting language package locally in the business line to obtain the updated target copywriting language package.

[0180] Further, based on any of the above embodiments, the above copywriting language pack updating device may further include:

[0181] A version switching module, configured to determine a target version corresponding to the version switching request when the business line server receives the version switching request, and obtain the language pack of the target version from the internationalized language pack synchronization server; wherein, the internationalized language pack synchronization server stores each version of the copywriting language pack.

[0182] It should be noted that the modules and units in the above copywriting language pack updating device can be changed in order before and after without affecting the logic.

[0183] A copywriting language pack updating device provided by an embodiment of the present invention may include: a merging module 100, configured to obtain the copywriting language packs corresponding to each storage channel from a preset number of storage channels in the internationalized language pack synchronization server for the language pack copywriting, and merge the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1; a synchronization and update module 200, configured to enable the business line server to synchronize the latest target copywriting language pack in the copywriting language pack file directory from the internationalized language pack synchronization server at a preset period, and compare and update it with the corresponding copywriting language pack locally on the business line to obtain an updated target copywriting language pack. Compared with the low local update efficiency of the current copywriting language pack, the present application can update the local copywriting language pack in a timely manner by using the copywriting language version obtained by the server from the internationalized language pack synchronization server at a preset period, improve the update efficiency of the copywriting language pack, and can load the latest copywriting language pack in the case of recompilation and restart. Moreover, since the merging and update of the copywriting language pack are responsible for different services, the system coupling can be reduced.

[0184] Next, a copywriting language pack updating device provided by an embodiment of the present invention is introduced. The copywriting language pack updating device described below can be mutually corresponding and referred to the copywriting language pack updating method described above.

[0185] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a copywriting language pack updating device provided by an embodiment of the present invention, and may include:

[0186] A memory 10, configured to store a computer program;

[0187] A processor 20, configured to execute the computer program to implement the above copywriting language pack updating method.

[0188] The memory 10, the processor 20, and the communication interface 30 all complete their mutual communication through the communication bus 40.

[0189] In the embodiment of the present invention, the memory 10 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory 10 may store a program for implementing the following functions:

[0190] The internationalized language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1;

[0191] The business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalized language pack synchronization server at a preset period, and compares and updates it with the copywriting language pack corresponding to the business line locally to obtain the updated target copywriting language pack.

[0192] In a possible implementation manner, the memory 10 may include a storage program area and a storage data area. Among them, the storage program area may store an operating system and application programs required for at least one function, etc.; the storage data area may store the data created during use.

[0193] In addition, the memory 10 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include NVRAM. The memory stores an operating system and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof. Among them, the operation instructions may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0194] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices. The processor 20 may be a microprocessor or any conventional processor, etc. The processor 20 may call the program stored in the memory 10.

[0195] The communication interface 30 may be an interface of a communication module for connecting to other devices or systems.

[0196] Of course, it should be noted that Figure 4 The structure shown does not constitute a limitation on the copywriting language pack update device in the embodiment of the present invention. In actual applications, the copywriting language pack update device may include more than Figure 4more or fewer components as shown, or combine certain components.

[0197] The readable storage medium provided by the embodiments of the present invention will be introduced below. The readable storage medium described below can be correspondingly referred to the copywriting language package update method described above.

[0198] The present invention also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above copywriting language package update method are implemented.

[0199] The readable storage medium may include: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.

[0200] The embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, refer to the description of the method part.

[0201] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0202] Finally, it should be noted that in this article, relationships such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0203] The above has introduced in detail a method, device, equipment and readable storage medium for updating a copywriting language package. In this article, specific examples are used to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for updating a copywriting language pack, characterized in that, Including: The internationalization language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1; The business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalization language pack synchronization server at a preset period, and compares and updates it with the copywriting language pack corresponding to the business line locally to obtain the updated target copywriting language pack.

2. The method for updating the copywriting language pack according to claim 1, wherein, The internationalization language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory, including: The internationalization language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from 3 storage channels, and obtains the copywriting language pack corresponding to the static resource file, the copywriting language pack corresponding to the object storage service, and the copywriting language pack corresponding to the database.

3. The method for updating the copywriting language pack according to claim 1, characterized in that The internationalization language pack synchronization server obtains the copywriting language packs corresponding to each storage channel from a preset number of storage channels, and merges the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory, including: Merging the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain the copywriting language pack file directory.

4. The copywriting language pack updating method according to claim 3, wherein, Merging the copywriting language packs corresponding to each storage channel based on the module type, deployment environment, and language environment to obtain the copywriting language pack file directory, including: When the copywriting language packs corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, merging the copywriting language packs based on the priority of each storage channel to obtain the copywriting language pack file directory.

5. The method for updating the copywriting language pack according to claim 4, characterized in that, Before merging the copywriting language packs based on the priority of each storage channel to obtain the copywriting language pack file directory when the copywriting language packs corresponding to each storage channel correspond to the same module type, deployment environment, and language environment, it further includes: Determining the priority of each storage channel based on the preference of the current module; wherein, the preference of the module includes business characteristics, update frequency, and security requirements.

6. The method for updating the copywriting language pack according to any one of claims 1 to 5, characterized in that The business line server synchronizes the latest target copywriting language pack in the copywriting language pack file directory from the internationalization language pack synchronization server at a preset period, and compares and updates it with the copywriting language pack corresponding to the business line locally to obtain the updated target copywriting language pack, including: The business line server receives a user request and parses the language environment of the user request to obtain language environment information; The business line server obtains the latest target copywriting language pack corresponding to the language environment information from the copywriting language pack file directory based on the language environment information, and compares and updates it with the copywriting language pack corresponding to the business line locally to obtain the updated target copywriting language pack.

7. The method for updating the copywriting language pack according to claim 1, characterized in that It also includes: When the business line server receives a version switching request, it determines the target version corresponding to the version switching request and obtains the language pack of the target version from the internationalized language pack synchronization server; wherein, the internationalized language pack synchronization server stores each version of the copywriting language pack.

8. A copywriting language pack update device, characterized in that Including: A merging module, configured to obtain the copywriting language packs corresponding to each storage channel from a preset number of storage channels in the internationalized language pack synchronization server for the copywriting language packs, and merge the copywriting language packs corresponding to each storage channel to obtain a copywriting language pack file directory; wherein, the preset number is greater than 1; A synchronization and update module, configured to enable the business line server to synchronize the latest target copywriting language pack in the copywriting language pack file directory from the internationalized language pack synchronization server at a preset period, and compare and update it with the copywriting language pack corresponding to the business line locally to obtain an updated target copywriting language pack.

9. A copywriting language pack update device, characterized in that Including: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the copywriting language pack update method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: A computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the copywriting language pack update method according to any one of claims 1 to 7 are implemented.