CN117850956A - Application package data processing method, device, electronic equipment and computer readable medium - Google Patents
Application package data processing method, device, electronic equipment and computer readable medium Download PDFInfo
- Publication number
- CN117850956A CN117850956A CN202410257071.3A CN202410257071A CN117850956A CN 117850956 A CN117850956 A CN 117850956A CN 202410257071 A CN202410257071 A CN 202410257071A CN 117850956 A CN117850956 A CN 117850956A
- Authority
- CN
- China
- Prior art keywords
- data
- application package
- character string
- language
- middleware
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000000034 method Methods 0.000 claims abstract description 26
- 238000013507 mapping Methods 0.000 claims abstract description 21
- 238000012545 processing Methods 0.000 claims abstract description 19
- 230000008859 change Effects 0.000 claims description 36
- 238000012508 change request Methods 0.000 claims description 24
- 230000004044 response Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 9
- 238000011161 development Methods 0.000 abstract description 2
- 238000006243 chemical reaction Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 7
- 235000010627 Phaseolus vulgaris Nutrition 0.000 description 6
- 244000046052 Phaseolus vulgaris Species 0.000 description 6
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 230000009467 reduction Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000010926 purge Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the disclosure discloses an application package data processing method, an application package data processing device, electronic equipment and a computer readable medium. One embodiment of the method comprises the following steps: according to the type of the target character string data, encoding and decoding the target character string data to obtain the character string data of the preset language; storing the obtained character string data in a language package file corresponding to a preset language to generate a mapping relation with target character string data; selecting a target language package file matched with the language environment setting information from a plurality of language package files according to the language environment setting information of the terminal where the application package is located; based on the target language package file and the mapping relation, the related data in the application package are displayed on the terminal according to the target language. The implementation method improves the multilingual coverage rate of the system, enriches the languages of which the application content can be displayed, and reduces the development workload.
Description
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to an application package data processing method, an apparatus, an electronic device, and a computer readable medium.
Background
Currently, in order to achieve multi-language support of string data by an application package, a terminal operating system generally needs to collect all the string data displayed in the application package. Most of the related art is managed and exposed by retrieving source codes, then manually collecting, and then writing to language packs.
However, the above-described manner has a first technical problem by: the character data of the application package is not fully acquired, so that the multilingual of the character string data is not fully acquired.
The above information disclosed in this background section is only for enhancement of understanding of the background of the inventive concept and, therefore, may contain information that does not form the prior art that is already known to those of ordinary skill in the art in this country.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose application package data processing methods, apparatuses, electronic devices, and computer readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an application packet data processing method, the method comprising: acquiring a binary file of a preset application package; determining a character string constant storage section in the binary file, wherein the character string constant storage section comprises a first constant storage section and a second constant storage section; determining target character string data in character string constants of a first format stored in the first constant storage section as first character string data, wherein the target character string data is a character string representing a preset language; determining target character string data in the unicode character string constant stored in the second constant storage section as second character string data; according to the type of the target character string data, encoding and decoding the target character string data to obtain character string data of the preset language; storing the obtained character string data in a language package file corresponding to the preset language so as to generate a mapping relation with the target character string data; selecting a target language package file matched with the language environment setting information from a plurality of language package files according to the language environment setting information of the terminal where the application package is located; and displaying the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
In a second aspect, some embodiments of the present disclosure provide an application packet data processing apparatus, the apparatus comprising: the acquisition unit is configured to acquire a binary file of a preset application package; a first determining unit configured to determine a string constant storing section in the binary file, where the string constant storing section includes a first constant storing section and a second constant storing section; a second determining unit configured to determine, as first string data, target string data in a string constant of a first format stored in the first constant storing section, wherein the target string data is a string representing a preset language; a third determining unit configured to determine target character string data in unicode character string constants stored in the second constant storing section as second character string data; a decoding unit configured to perform encoding and decoding processing on the target character string data according to the type of the target character string data to obtain character string data of the preset language; a storage unit configured to store the obtained character string data in a language package file corresponding to the preset language, so as to generate a mapping relation with the target character string data; a selecting unit configured to select a target language pack file matching with language environment setting information from a plurality of language pack files according to the language environment setting information of a terminal where an application pack is located; and a display unit configured to display the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantageous effects: by the application package data processing method of some embodiments of the present disclosure, the comprehensiveness of the multi-linguistic character string data is improved. Specifically, the reason for the incomplete multilingual conversion of character string data is that: the character data of the application package is not fully acquired, so that the multilingual of the character string data is not fully acquired. Based on this, the application package data processing method of some embodiments of the present disclosure first obtains a binary file of a preset application package. And secondly, determining a character string constant storage section in the binary file, wherein the character string constant storage section comprises a first constant storage section and a second constant storage section. And determining target character string data in the character string constant of the first format stored in the first constant storage section as first character string data, wherein the target character string data is a character string representing a preset language. And determining target character string data in the unicode character string constant stored in the second constant storage section as second character string data. And then, according to the type of the target character string data, carrying out encoding and decoding processing on the target character string data to obtain the character string data of the preset language. And then, storing the obtained character string data in a language package file corresponding to the preset language so as to generate a mapping relation with the target character string data. And then, selecting a target language package file matched with the language environment setting information from the multiple language package files according to the language environment setting information of the terminal where the application package is located. And finally, displaying the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation. Thus, the strings of the desired language are automatically collected by analyzing the binary files in the corresponding application packages. Therefore, the problem that the multi-language cannot be supported because the source code part cannot be obtained is solved, meanwhile, the character string data can be collected in an all-around manner through automation, and the character string data can be automatically written into a corresponding language packet. Therefore, the multilingual coverage rate of the system can be greatly improved, the languages with displayable application content are enriched, and the development workload is reduced.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of some embodiments of an application package data processing method according to the present disclosure;
FIG. 2 is a flow chart of some embodiments of an application package data processing apparatus according to the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a flow chart of some embodiments of an application packet data processing method according to the present disclosure. A flow 100 of some embodiments of an application package data processing method according to the present disclosure is shown. The application package data processing method comprises the following steps:
Step 101, obtaining a binary file of a preset application package.
In some embodiments, an execution body (e.g., a computing device) of the application package data processing method may obtain a binary file of a preset application package. Here, the preset application package may be any application package suitable for an execution subject (system), such as various applications installed on a terminal operating system. The execution body may acquire a binary file of a preset application package. As an example, the execution body may parse the data in the installation package to obtain the binary file therein. For another example, the execution body may modify the suffix name of the preset application package into a compressed file format (e.g., zip). Then, the modified application package can be decompressed, so that a binary file of the preset application package is obtained.
Step 102, determining the constant storage section of the character string in the binary file.
In some embodiments, the execution body may determine a string constant storing section in the binary file. The character string constant storage section comprises a first constant storage section and a second constant storage section. The character string constant storing section comprises a first constant storing section (corresponding to __ cstring section) and a second constant storing section (corresponding to __ stasting section).
Step 103, determining target character string data in the character string constant of the first format stored in the first constant storage section as first character string data.
In some embodiments, the execution body may determine target string data in a string constant of a first format stored in the first constant storing section as the first string data. Wherein the target character string data is a character string representing a preset language. Wherein, the character string constant of the first format is generally stored in __ cstring section; while string constants for NSString objects are typically stored in __ ustring sections. That is, __ cstring and __ ustring sections are typically sections (sections) for storing string constants. They contain all string constants used in the program, such as the amount of string literals in the code, constant strings, etc. The __ cstring section is generally used to store a string constant in the first format, i.e., a string ending in null. These string constants are determined at compile time and read-only at run time. __ Ultring section is commonly used to store Unicode string constants.
As an example, the execution body may obtain the corresponding strings of __ ustring and __ cstring, respectively, by analyzing the command line tool of the Mach-O file. I.e. all encoded strings are collected row by row. Furthermore, the Chinese code strings in the collected Chinese code strings can be screened and stored in a file.
And 104, determining target character string data in the unicode character string constant stored in the second constant storage section as second character string data.
In some embodiments, the execution body may determine target string data in the unicode string constant stored in the second constant storing section as second string data.
And 105, performing encoding and decoding processing on the target character string data according to the type of the target character string data to obtain the character string data of the preset language.
In some embodiments, the execution body may perform encoding and decoding processing on the target string data according to the type of the target string data, to obtain string data of the preset language.
Continuing, when the application packet data processing method of the present application is used to perform multilingual processing on the character string data, the following problem two is often associated: the technician is required to perform multilingual conversion on the character string data one by one, and data conversion errors are easy to cause.
For the second technical problem, the following solution is decided to be adopted.
In practice, the execution body may perform the encoding and decoding process on the target string data by:
And a first step of acquiring at least one piece of octal data in the first character string data according to a preset separator.
And a second step of converting the octal data into hexadecimal data for each piece of octal data in the at least one piece of octal data, and taking out specified bit data in the hexadecimal data to obtain at least one group of data.
And thirdly, decoding the at least one group of data through preset encoding to obtain character string data corresponding to the preset language.
It should be noted that, here, the data segment of the first format string is similar to the encoded data of "\3555644\3555670\3555655". This is a special octal data, which is analyzed by extensive data observation. The entire data is partitioned by "\" and octals for each segment are acquired. Then, octal is converted into hexadecimal data, and then AND operation (≡) is performed with OxFF to obtain "\xe4", "\xb8", "\ xad". Wherein OxFF is hexadecimal expression. Here, the and operation with OxFF is equivalent to taking the last two hexadecimal bits. And splicing the obtained data to obtain hexadecimal data of "\xe4\xb8\ xad". Then, utf-8 decoding can be performed on the hexadecimal data to obtain a final Chinese character string: "middle".
And step four, hexadecimal data indicating the content data in the second character string data is selected.
And fifthly, converting the hexadecimal data into character strings to obtain content character strings. The execution body may match non-null characters in the hexadecimal data using a regular expression, and splice the non-null characters according to a data sequence to obtain at least one content string. Wherein the null character acts as a separator between the content strings.
And sixthly, decoding the content character string through preset coding to obtain character string data corresponding to the preset language.
Here, the data segment of a Unicode (Unicode) string resembles "000000010000add6 f18287650000395f977a c47e f64e75 98". The data corresponding web address and content element are contained. For this case, the hexadecimal data of "f18287650000395f977a c47e f64e7598" can be obtained by first removing the web address information and retaining the content data. The hexadecimal data is then converted into a string, which facilitates subsequent encoding, resulting in "f18287650000395f977ac47ef64e7598" data. And then, decoding the character string data by using an utf-16 coding mode to obtain the corresponding Chinese character string data.
The above related matters serve as an invention point of the present disclosure, and solve the second technical problem of easily causing data conversion errors. ". Factors that easily cause data conversion errors are often as follows: the technician is required to perform multilingual conversion on the character string data one by one. If the above factors are solved, the effect of reducing the data conversion errors can be achieved. To achieve this, first, at least one piece of octal data in the first character string data is acquired according to a preset separator. And secondly, converting the octal data into hexadecimal data for each piece of octal data in the at least one piece of octal data, and taking out specified bit data in the hexadecimal data to obtain at least one group of data. And then, decoding the at least one group of data through preset coding to obtain character string data corresponding to the preset language. Then, hexadecimal data indicating the content data in the second character string data is selected. And then, converting the hexadecimal data into character strings to obtain content character strings. And finally, decoding the content character string through preset coding to obtain character string data corresponding to the preset language. Therefore, the character string data can be automatically converted into the data of the preset language through the binary conversion among the data, and the language conversion efficiency is greatly improved. In addition, with the correspondence between the binary data, the data conversion error can be reduced.
And 106, storing the obtained character string data in a language package file corresponding to the preset language to generate a mapping relation with the target character string data.
In some embodiments, the execution body may store the obtained character string data in a language pack file corresponding to the preset language, so as to generate a mapping relationship with the target character string data. The restored character string data may be output to a file in a designated format. This mapping may be stored here using JSON (JavaScript Object Notation, lightweight data exchange format), XML (extensible markup language) or other format. This can be achieved: the automatic process of character string collection includes that binary file searching character string searching and collecting of preset language (Chinese for example) character string searching and collecting of preset language character string encoding and decoding reduction and format outputting to file.
And 107, selecting a target language package file matched with the language environment setting information from the multiple language package files according to the language environment setting information of the terminal where the application package is located.
In some embodiments, the executing body may select, according to language environment setting information of a terminal where the application package is located, a target language package file matching the language environment setting information from multiple language package files. If the language environment setting information of the terminal using the system is Chinese, a file display interface (API) can be modified into a Chinese language pack in the newly added language pack file.
And step 108, displaying the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
In some embodiments, the execution body may display related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation. For example, "application description details" in the application package may be displayed as a chinese string "application description details".
Continuing, when the application packet data processing method of the present application is used for application packet data processing, the following problems are often associated with the application packet data processing method: the application package needs to call the middleware to ensure the normal operation of the application package. For these problems, the conventional solutions are: the middleware is registered and called through the built-in configuration file so as to ensure the normal operation of the application package.
However, the above solution generally has the following technical problem three: in the running of the application package, if the configuration of aliases, timeout time and the like is to be modified to meet the application requirement, the configuration file needs to be modified again, and a new application package is reissued.
Aiming at the third technical problem, the following solution is adopted.
Optionally, in response to detecting a change request characterizing application package middleware configuration data, determining whether there is configuration data in the existing configuration data that matches the application package configuration data.
In some embodiments, the execution body may determine whether there is configuration data matching the application package configuration data in the existing configuration data in response to detecting a change request characterizing the application package middleware configuration data. The application package configuration data is configuration data of application package middleware indicated by the change request. The configuration data may be set according to practical situations, for example, the configuration data of the application package middleware may include, but is not limited to: the application package middleware such as interface identification (such as interface class name), alias, timeout time, serialization mode, retry times, connection key and the like registers the common parameters. The application package middleware may refer to middleware that the preset application package needs to invoke a program service. The application package configuration data may be configuration data of the application package middleware indicated by the change request.
In practice, the execution body may determine whether there is configuration data matching the application package configuration data in the existing configuration data by:
And a first step of determining whether the interface identifier of the application package middleware exists in the pre-created configuration data record. The configuration data record is used for storing the latest configuration data of each application package middleware.
And a second step of determining that no matched configuration data exists in the existing configuration data in response to determining that the interface identifier of the application package middleware does not exist or determining that the configuration data of the application package middleware is different from the configuration data of the application package in the configuration data record.
And thirdly, in response to determining that the configuration data of the application package middleware is changed, storing the application package configuration data into the configuration data record.
Optionally, in response to determining that there is no matching configuration data, creating a new instance of the application package middleware and obtaining relying party information that references the application package middleware.
In some embodiments, the execution body may, in response to determining that no matching configuration data exists, create a new instance of the application package middleware and obtain relying party information that references the application package middleware. In practice, the executing body may obtain, according to the interface identifier in the application packet configuration data, an instance of a class to which the interface identifier belongs, and obtain an object list of instances that depend on the class. Wherein the object information features in the object list refer to the relying party information of the application package middleware. A new instance object can be created through generalization of the registry configuration (RegistryConfig) and caller configuration (convermenfig) built in the application package middleware. The execution body can also adopt various existing instance object creation methods to create new instances according to the differences of application package middleware. The new example here employs the parameter data in the application package configuration data described above. That is, the interface Class name in the application package configuration data can be used for obtaining the Class (Class) instance in the system, and all Bean lists relying on the Class instance can be obtained through the Spring capability. Specifically, the Bean factory of IoC (Inversion of Control, control inversion) is obtained by the context of Spring. The Bean factory can obtain a Bean list which depends on a certain Class instance from the IoC dependency relationship.
Optionally, changing the correspondence between the relying party information and the application package middleware into a new instance of the application package middleware.
In some embodiments, the execution body may change the correspondence between the relying party information and the application package middleware to a new instance of the application package middleware. In practice, the execution body may change field data characterizing the application package middleware in the relying party information into a new instance of the application package middleware. The execution body may loop through all Bean lists that rely on the current application package middleware. The application package middleware dependency field in the current Bean is reassigned through Java built-in capability-reflection. The reflection (reflection) mechanism generally refers to that in the running state of a program, an object of any one class can be constructed, the class to which any one object belongs can be known, the member variable and method of any one class can be known, and the attribute and method of any one object can be invoked.
Optionally, in response to determining that the number of the application package middleware indicated by the change request is multiple, and the configuration data of the multiple application package middleware is changed, determining to restore the application package middleware according to a comparison result of the change request and the previous change request.
In some embodiments, the execution body may determine to restore the application package middleware according to a comparison result between the change request and the previous change request in response to determining that the application package middleware indicated by the change request is a plurality of application package middleware, and configuration data of the plurality of application package middleware is changed. The restoring application package middleware is the application package middleware indicated by the last change request and not indicated by the change request. The restoring application package middleware may be application package middleware indicated by the previous change request and not indicated by the current change request. For example, the first change is configured as [ JSF-1, JSF-2], and the second change is configured as [ JSF-2]. Then the purpose of this change operation is to both change JSF-2 and restore JSF-1 to the original instance in the second change. As no changes to JSF-1 are already required.
In practice, the execution entity may compare and analyze the temporary change record with a global change record created in advance, and determine an application package middleware recorded in the global change record and not recorded in the temporary change record as a restore application package middleware. The global change record is used for storing the application package middleware instance of the latest change.
Optionally, the configuration data of the restoring application package middleware is restored to the original configuration data.
In some embodiments, the execution body may restore the configuration data of the restore application package middleware to original configuration data. The original configuration data here is typically the initial configuration data of each application package middleware at the system initialization start-up. As an example, the execution body may create an original instance of the restore application package middleware from the original configuration data.
In practice, the execution body may restore the configuration data of the restore application package middleware to the original configuration data by:
first, the original instance of the restoring application package middleware is obtained from a pre-created original instance record. The original instance records are used for storing the original instance of each application package middleware in the system.
And secondly, changing the corresponding relation between the relying party information of the reduction application package middleware and the reduction application package middleware into an original instance of the reduction application package middleware.
Optionally, the new instance of the application package middleware is stored in a pre-created temporary change record.
In some embodiments, the execution body may store the new instance of the application package middleware into a temporary change record created in advance. Thus, stored in the global change record is the application package middleware instance of the latest change in the system. In addition, the executing body may also clear the data in the temporary change record to store the next new instance of change. Or the temporary change record may be deleted for re-creation at the next change.
Optionally, in response to determining that the restore application package middleware is complete, replacing data in the global change record with data in the temporary change record, and clearing the data in the temporary change record.
In some embodiments, the execution body may replace data in the global change log with data in the temporary change log and purge data in the temporary change log in response to determining that the restore application package middleware is complete.
The above related matters serve as an invention point of the present disclosure, and solve the third technical problem of reissuing a new application package. ". The factors for reissuing a new application package are often as follows: in the running of the application package, if the configuration of aliases, timeout time and the like is to be modified to meet the application requirement, the configuration file needs to be modified again, and a new application package is reissued. If the above factors are solved, the effects of realizing noninductive change of the middleware configuration data and ensuring timeliness of the configuration change can be achieved. To achieve this, first, in response to detecting a change request characterizing application package middleware configuration data, it is determined whether there is configuration data matching the application package configuration data in the existing configuration data. The application package configuration data is configuration data of application package middleware indicated by the change request. Second, in response to determining that there is no matching configuration data, a new instance of the application package middleware is created, and relying party information referencing the application package middleware is obtained. And then, changing the corresponding relation between the relying party information and the application package middleware into a new instance of the application package middleware. Thus, when a configuration data change request is detected, and no matching configuration data exists in the existing configuration data, a new instance of the application package middleware can be created according to the application package configuration data. This allows for automatic creation and generation of new instances without requiring manual creation. Thus, the method is helpful to reduce the change duration and reduce or avoid errors caused by manual change. And then, in response to determining that the number of the application package middleware indicated by the change request is multiple, and the configuration data of the application package middleware are changed, determining to restore the application package middleware according to the comparison result of the change request and the last change request. The restoring application package middleware is the application package middleware indicated by the last change request and not indicated by the change request. And then, restoring the configuration data of the restoring application package middleware into the original configuration data. And then, storing the new instance of the application package middleware into a pre-created temporary change record. Finally, in response to determining that the restore application package middleware is complete, replacing the data in the global change record with the data in the temporary change record, and clearing the data in the temporary change record. Therefore, the new instance can replace the original reference, so that the middleware instance which is insensitive to the service is changed. Because the configuration is placed in the configuration center, instances of middleware can be dynamically and flexibly controlled.
With further reference to fig. 2, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of an application packet data processing apparatus, which correspond to those method embodiments shown in fig. 1, and which are particularly applicable in various electronic devices.
As shown in fig. 2, the application packet data processing apparatus 200 of some embodiments includes: an acquisition unit 201, a first determination unit 202, a second determination unit 203, a third determination unit 204, a decoding unit 205, a storage unit 206, a selection unit 207, and a display unit 208. Wherein, the obtaining unit 201 is configured to obtain a binary file of a preset application package; a first determining unit 202 configured to determine a string constant storing section in the binary file, wherein the string constant storing section includes a first constant storing section and a second constant storing section; a second determining unit 203 configured to determine, as first string data, target string data in a string constant of a first format stored in the first constant storing section, where the target string data is a string representing a preset language; a third determining unit 204 configured to determine target string data in unicode string constants stored in the second constant storing section as second string data; a decoding unit 205 configured to perform encoding and decoding processing on the target character string data according to the type of the target character string data, so as to obtain character string data of the preset language; a storage unit 206 configured to store the obtained character string data in a language pack file corresponding to the preset language, so as to generate a mapping relationship with the target character string data; a selecting unit 207 configured to select a target language pack file matching the language environment setting information from among a plurality of language pack files according to the language environment setting information of the terminal in which the application pack is located; and a display unit 208 configured to display the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
It will be appreciated that the elements described in the application package data processing apparatus 200 correspond to the individual steps of the method described with reference to fig. 1. Thus, the operations, features and advantages described above with respect to the method are equally applicable to the application packet data processing device 200 and the units contained therein, and are not described here again.
Referring now to FIG. 3, a schematic diagram of an electronic device (e.g., computing device) 300 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM302, and the RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 3 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 309, or from storage device 308, or from ROM 302. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a binary file of a preset application package; determining a character string constant storage section in the binary file, wherein the character string constant storage section comprises a first constant storage section and a second constant storage section; determining target character string data in character string constants of a first format stored in the first constant storage section as first character string data, wherein the target character string data is a character string representing a preset language; determining target character string data in the unicode character string constant stored in the second constant storage section as second character string data; according to the type of the target character string data, encoding and decoding the target character string data to obtain character string data of the preset language; storing the obtained character string data in a language package file corresponding to the preset language so as to generate a mapping relation with the target character string data; selecting a target language package file matched with the language environment setting information from a plurality of language package files according to the language environment setting information of the terminal where the application package is located; and displaying the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor comprising: the device comprises an acquisition unit, a first determination unit, a second determination unit, a third determination unit, a decoding unit, a storage unit, a selection unit and a display unit. The names of these units do not limit the unit itself in some cases, and the acquisition unit may also be described as "a unit that acquires a binary file of a preset application package", for example.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.
Claims (7)
1. An application package data processing method, comprising:
acquiring a binary file of a preset application package;
determining a character string constant storage section in the binary file, wherein the character string constant storage section comprises a first constant storage section and a second constant storage section;
determining target character string data in character string constants of a first format stored in the first constant storage section as first character string data, wherein the target character string data is a character string representing a preset language;
determining target character string data in the unicode character string constant stored in the second constant storage section as second character string data;
according to the type of the target character string data, encoding and decoding the target character string data to obtain character string data of the preset language;
storing the obtained character string data in a language package file corresponding to the preset language so as to generate a mapping relation with the target character string data;
selecting a target language package file matched with the language environment setting information from a plurality of language package files according to the language environment setting information of the terminal where the application package is located;
And displaying the related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
2. The method of claim 1, wherein the method further comprises:
in response to detecting a change request for representing application package middleware configuration data, determining whether the existing configuration data contains configuration data matched with the application package configuration data, wherein the application package configuration data is the configuration data of the application package middleware indicated by the change request;
in response to determining that there is no matching configuration data, creating a new instance of the application package middleware, and obtaining relying party information referencing the application package middleware;
and changing the corresponding relation between the relying party information and the application package middleware into a new instance of the application package middleware.
3. The method of claim 2, wherein the determining whether there is configuration data in the existing configuration data that matches the application package configuration data comprises:
determining whether an interface identifier of the application package middleware exists in a pre-established configuration data record, wherein the configuration data record is used for storing the latest configuration data of each application package middleware;
Responsive to determining that no interface identifier of the application package middleware exists or determining that configuration data of the application package middleware is different from the application package configuration data in the configuration data record, determining that no matched configuration data exists in the existing configuration data;
and in response to determining that the configuration data change of the application package middleware is completed, storing the application package configuration data into the configuration data record.
4. The method of claim 2, wherein the changing the correspondence between the relying party information and the application package middleware to a new instance of the application package middleware comprises:
and changing field data representing the application package middleware in the relying party information into a new instance of the application package middleware.
5. An application packet data processing apparatus comprising:
the acquisition unit is configured to acquire a binary file of a preset application package;
a first determining unit configured to determine a string constant storing section in the binary file, wherein the string constant storing section includes a first constant storing section and a second constant storing section;
a second determining unit configured to determine, as first string data, target string data in a string constant of a first format stored in the first constant storing section, wherein the target string data is a string representing a preset language;
A third determining unit configured to determine target character string data in unicode character string constants stored in the second constant storing section as second character string data;
the decoding unit is configured to encode and decode the target character string data according to the type of the target character string data to obtain the character string data of the preset language;
a storage unit configured to store the obtained character string data in a language pack file corresponding to the preset language, so as to generate a mapping relation with the target character string data;
the selecting unit is configured to select a target language pack file matched with the language environment setting information from a plurality of language pack files according to the language environment setting information of the terminal where the application pack is located;
and the display unit is configured to display related data in the application package on the terminal according to the target language based on the target language package file and the mapping relation.
6. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
7. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410257071.3A CN117850956B (en) | 2024-03-07 | 2024-03-07 | Application package data processing method, device, electronic equipment and computer readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410257071.3A CN117850956B (en) | 2024-03-07 | 2024-03-07 | Application package data processing method, device, electronic equipment and computer readable medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117850956A true CN117850956A (en) | 2024-04-09 |
CN117850956B CN117850956B (en) | 2024-06-11 |
Family
ID=90532775
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410257071.3A Active CN117850956B (en) | 2024-03-07 | 2024-03-07 | Application package data processing method, device, electronic equipment and computer readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117850956B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111626045A (en) * | 2020-05-28 | 2020-09-04 | 北京字节跳动网络技术有限公司 | Character length calculation method and device and electronic equipment |
CN112052006A (en) * | 2020-08-12 | 2020-12-08 | 武汉天喻信息产业股份有限公司 | Software code compiling method and system |
US20230129159A1 (en) * | 2021-10-22 | 2023-04-27 | EMC IP Holding Company LLC | Method, device and computer program product for application testing |
-
2024
- 2024-03-07 CN CN202410257071.3A patent/CN117850956B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111626045A (en) * | 2020-05-28 | 2020-09-04 | 北京字节跳动网络技术有限公司 | Character length calculation method and device and electronic equipment |
CN112052006A (en) * | 2020-08-12 | 2020-12-08 | 武汉天喻信息产业股份有限公司 | Software code compiling method and system |
US20230129159A1 (en) * | 2021-10-22 | 2023-04-27 | EMC IP Holding Company LLC | Method, device and computer program product for application testing |
Also Published As
Publication number | Publication date |
---|---|
CN117850956B (en) | 2024-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111291103B (en) | Interface data analysis method and device, electronic equipment and storage medium | |
CN111309304B (en) | Method, device, medium and electronic equipment for generating IDL file | |
CN112965761B (en) | Data processing method, system, electronic equipment and storage medium | |
CN112395253B (en) | Index file generation method, terminal device, electronic device and medium | |
CN111857720B (en) | User interface state information generation method and device, electronic equipment and medium | |
CN111897827B (en) | Data updating method and system for data warehouse and electronic equipment | |
CN111124541B (en) | Configuration file generation method, device, equipment and medium | |
CN116226189A (en) | Cache data query method, device, electronic equipment and computer readable medium | |
CN111198853B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
CN117850956B (en) | Application package data processing method, device, electronic equipment and computer readable medium | |
CN111752644A (en) | Interface simulation method, device, equipment and storage medium | |
CN112817874B (en) | User interface testing method, device, equipment and medium | |
CN111399902B (en) | Client source file processing method and device, readable medium and electronic equipment | |
CN110968334B (en) | Application resource updating method, resource package manufacturing method, device, medium and equipment | |
CN118012470B (en) | Updating method and device for power information management application, electronic equipment and medium | |
CN116467178B (en) | Database detection method, apparatus, electronic device and computer readable medium | |
CN113760698A (en) | Method and device for converting test case file data | |
CN112688863B (en) | Gateway data processing method and device and electronic equipment | |
CN115374320B (en) | Text matching method and device, electronic equipment and computer medium | |
CN117707541A (en) | Character string data collection method, device, electronic equipment and computer readable medium | |
CN115098453B (en) | Information storage method, apparatus, electronic device, and computer readable medium | |
CN114936387B (en) | Text file reading method, text file writing method, electronic equipment and readable storage medium | |
CN110908867B (en) | Task completion judging method and device, storage medium and electronic equipment | |
CN117807167A (en) | Database table copying method, apparatus, electronic device and computer readable medium | |
CN117555542A (en) | Transcoding method, transcoding device, electronic device and computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |