WO2021143371A1 - Method, apparatus, and device for generating applet page - Google Patents

Method, apparatus, and device for generating applet page Download PDF

Info

Publication number
WO2021143371A1
WO2021143371A1 PCT/CN2020/132622 CN2020132622W WO2021143371A1 WO 2021143371 A1 WO2021143371 A1 WO 2021143371A1 CN 2020132622 W CN2020132622 W CN 2020132622W WO 2021143371 A1 WO2021143371 A1 WO 2021143371A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
page data
applet
language
terminal device
Prior art date
Application number
PCT/CN2020/132622
Other languages
French (fr)
Chinese (zh)
Inventor
常艺耀
林杰
王金生
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021143371A1 publication Critical patent/WO2021143371A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation

Definitions

  • One or more embodiments of this specification relate to the field of computer technology, and in particular to a method, device, and device for generating a small program page.
  • An applet is an application that can be used without downloading and installing. Users can call the applet on the host application, which is very convenient to use. At present, since the host application usually has multiple language environments, users can control the language presented by the page data of the host application according to actual needs. However, the page data of the applet can usually only be presented in a certain fixed language, which cannot be consistent with the language presented by the page data of the host application, which brings inconvenience to the user in using the applet.
  • one or more embodiments of this specification provide a method, device and device for generating applet pages, which are used to realize the adaptation of the applet to the language environment of the App, so that the applet and the host application’s page data
  • the languages presented are consistent.
  • An embodiment of the present specification provides a method for generating an applet page, including: obtaining a first generation request for a page of an applet, the applet being started in a host application; obtaining the first language of the host application Information, the first language information is used to indicate the language used by the first page data of the host application; the second page data of the page is determined, and the language used by the second page data is the first language The language of the information; based on the second page data, the page is generated.
  • An apparatus for generating an applet page includes: a first obtaining module, configured to obtain a first request for generating a page of an applet, the applet being started in a host application; and second The obtaining module is used to obtain the first language information of the host application, and the first language information is used to indicate the language used by the first page data of the host application; the first determining module is used to determine the page The language used in the second page data is the language indicated by the first language information; the first page generating module is configured to generate the page based on the second page data.
  • the device for generating a small program page includes: at least one processor; and,
  • the device can: obtain the first generation request for the page of the applet, the applet being started in the host application;
  • the first language information of the host application where the first language information is used to indicate the language used by the first page data of the host application; determine the second page data of the page, the second page data The language used is the language indicated by the first language information; the page is generated based on the second page data.
  • An embodiment of the present specification achieves the following beneficial effects: by obtaining the first language information of the host application when a request for generating a page of the applet is received, and determining the second page data of the page, the first The language used in the second page data is the language indicated by the first language information, so as to generate the page of the applet based on the second page data.
  • the second page data in the same language as the host application can be determined, and the page of the applet is generated based on the second page data, so that the language presented by the page data of the applet and the host application remains Consistent, realizes the adaptation of the applet to the language environment of the App, which is beneficial to improve the user experience.
  • FIG. 1 is a schematic diagram of an application page of an application program provided by an embodiment of this specification
  • FIG. 2 is a schematic flowchart of a method for generating a small program page provided by an embodiment of this specification
  • FIG. 3 is a schematic diagram of a page of an applet generated based on the method in FIG. 2 according to an embodiment of the specification;
  • FIG. 4 is a schematic structural diagram of an apparatus for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification;
  • FIG. 5 is a schematic structural diagram of a device for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification.
  • the host application is an application program deployed on a terminal device, and the user can activate the applet by triggering the applet icon on the application page of the host application.
  • the applet is a webpage structure framework program that can be run by relying on the application of the host application and developed independently of the application of the host application.
  • host applications usually have multiple language environments. Users can set the current language environment of the host application according to actual needs, so that the data in the application page of the host application is presented in the language corresponding to the language environment set by the user, so as to facilitate The user uses the host application.
  • the page data of an applet can usually only be presented in a certain fixed language.
  • FIG. 1 is a schematic diagram of an application page of an application program provided in an embodiment of this specification.
  • the application page 101 of the host application is displayed on the terminal device. It can be seen that the language used for the page data "Mini Programs" in the application page 101 is English.
  • the application page 101 also contains a "movie" applet icon 102 and a "taxi” applet icon 103. After the user triggers the "taxi” applet icon 103, the terminal device will display the application page of the "taxi” applet. It is assumed that the page data of the applet can only be presented in simplified Chinese. As shown in FIG.
  • the language of the page data "taxi", "starting point”, “destination” and so on in the application page 104 of the "taxi” applet is Simplified Chinese. Because the language presented by the page data of the applet and the host application cannot be consistent, the user experience is affected.
  • FIG. 2 is a schematic flowchart of a method for generating a small program page provided by an embodiment of this specification. From a program perspective, the execution subject of the process can be a small program running on a terminal device.
  • the process may include the following steps 202 to 208.
  • Step 202 Obtain a first generation request for the page of the applet, the applet being started in the host application.
  • the applet when the user triggers the icon of the applet, or part of the buttons or hyperlinks in the application page that triggers the applet, the applet can recognize the user's triggering operation, thereby generating a page corresponding to the triggering operation The build request.
  • the applet is launched in the host application, and the host application is carried in the terminal device.
  • Step 204 Obtain the first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application.
  • the applet can obtain the first language information of the host application by monitoring the language environment of the host application, and the language indicated by the first language information is the current application page of the host application The language in which the data needs to be presented.
  • the language environment of the host application generally refers to the language used (or required to be presented) in the page data of the host application set by the user.
  • the language corresponding to the language environment of the host application can include: simplified Chinese, traditional Chinese , American English, Thai, Indonesian, Arabic, etc.
  • the user can set the language environment of the host application according to actual needs, so that the language presented by the page data of the host application is the language corresponding to the language environment set by the user. For example, assuming that the language environment currently set by the user for the host application is en-US, the acquired first language information of the host application may indicate English.
  • Step 206 Determine the second page data of the page, and the language used in the second page data is the language indicated by the first language information.
  • the page data (that is, the second page data) corresponding to the page generation request in step 202.
  • the page data may include text information (for example, title, description, etc.), icon information, picture information, hyperlink information, etc. in the page.
  • Step 206 may specifically include: determining the second page data of the page from the page data set of the applet stored locally in the terminal device, the terminal device is loaded with the host application, and the page data set Contains page data corresponding to the page in multiple languages.
  • the terminal device may store the page data set of the applet, the page data in the page data set may have a language identifier, and the language identifier may be used to indicate the language used by the page data, or ,
  • the language identifier can be used to indicate the language that the page data needs to be presented in the applet page. Therefore, it is possible to obtain from the terminal device locally the language identifier corresponding to the language indicated by the first language information and the page data corresponding to the page as the second page data.
  • the speed is faster, which can improve the efficiency of generating and displaying the applet page corresponding to the page generation request, reduce the waiting time of the user, and improve the user experience.
  • Step 206 may specifically include: obtaining the second page data of the page from the server of the applet.
  • a page data acquisition request can be sent to the server of the applet.
  • the page data acquisition request is used to request page data whose language is the language indicated by the first language information and corresponds to the page generation request in step 202 (That is, the second page data).
  • the server of the applet may pre-store the page data set of the applet, and the page data set may contain page data in multiple languages. Since the page data collection at the applet server is generated in advance, it is convenient to calibrate each page data in the page data collection. Therefore, the accuracy of the page data in the page data collection is relatively high.
  • the server receives the page data acquisition request, it can determine the second page data from the pre-stored page data in multiple languages, and feed it back to the terminal device.
  • This implementation manner can quickly determine the second page data with higher accuracy, and does not require the terminal device to pre-store the page data of the applet, thereby reducing the occupation of the storage space of the terminal device.
  • the server of the applet may only pre-store the page data of a single language.
  • the pre-stored page data corresponding to the page generation request in step 202 can be translated to generate the second page data and feed it back to the terminal device.
  • the storage space of the terminal device can be reduced. And because the server that does not need a small program stores page data in multiple languages, the storage space of the server can be reduced.
  • the second page data of the page may include fixed page information or variable page information.
  • page fixed information refers to information that does not change on the page when the page is displayed at different times, for example, button description information, or partial title information.
  • page variable information refers to information that can change on the page when the page is displayed at different times, for example, news content, user personal data and other information.
  • the page fixed information may be stored locally in the terminal device in advance, so as to obtain the page fixed information locally from the terminal device.
  • the page variable information is stored in the applet's server to obtain the page variable information from the applet's server.
  • the content and type of the page data stored locally on the terminal device and the applet server are not specifically limited, and the applet maintainer can set it by himself according to actual needs.
  • Step 208 Generate the page based on the second page data.
  • the applet has executable code (Executable Code), and the terminal device can run the executable code of the applet to generate a page for displaying the data of the second page, and the generated The page is displayed on the terminal device.
  • executable code Executable Code
  • FIG. 3 is a schematic diagram of a page of an applet generated based on the method in FIG. 2 according to an embodiment of this specification.
  • an application page 301 of the host application is displayed on the terminal device. It can be seen that the language used for the page data "Mini Programs" in the application page 301 is English.
  • the application page 101 also includes a "movie" applet icon 302 and a "taxi” applet icon 303. Since the language of the text information in the icon 303 of the "taxi” applet is simplified Chinese, it can be known that the initial language preset during the development of the "taxi” applet is simplified Chinese. After the user triggers the "taxi" applet icon 303, based on the method in FIG.
  • the terminal device will display the application page of the "taxi” applet.
  • the language used for the page data "Taxi”, “Start”, “End”, etc. in the application page 304 of the "Taxi” applet is English. That is, the page of the applet generated based on the method in FIG. 2 and the page of the host application use the same language.
  • the method in FIG. 2 can determine the second page data corresponding to the page generation request of the applet, and the language of the second page data is the same as that of the host application, and the applet is generated based on the second page data.
  • the page of the program keeps the language presented in the page data of the applet and the host application consistent, and realizes the adaptation of the applet to the language environment of the host application, which is conducive to improving the user experience.
  • step 206 before the second page data is determined locally from the terminal device, it can be determined whether the terminal device locally stores the page data set of the applet.
  • the terminal device locally determines the second page data. If not, there are two situations. The first is that the page data collection of the applet stored locally on the terminal device is deleted; the second is that the page data set of the applet that has not been stored locally on the terminal device corresponds to A scenario where the user launches the applet through the host application for the first time; at this time, the page data collection of the applet needs to be downloaded from the server of the applet to determine the second page data locally from the terminal device.
  • the page data set of the applet stored locally from the terminal device before determining the second page data of the page, it may further include: determining whether the terminal device locally stores the page data of the applet Collect, get the first judgment result.
  • a page data set acquisition request is sent to the server of the applet, so that the terminal device can obtain the applet.
  • the second page data of the page can be determined from the page data collection of the applet stored locally in the terminal device.
  • the page data collection of the applet in the terminal device is obtained from the server of the applet.
  • the page data and the language of the page data in the page data collection at the server of the applet may change. For example, a new language page data may be added to the page data collection at the server of the applet. Therefore, in order to distinguish page data sets that contain different data, different version information can be set for each page data set that contains different data.
  • the terminal device may further include:
  • the second page data of the page is determined from the page data set of the applet stored locally in the terminal device.
  • the page data set of the first version information is obtained from the server.
  • the page data storing the first version information is collected locally on the terminal device.
  • the second page data of the page is determined from the page data set of the first version information stored locally in the terminal device.
  • the step 202 is for all
  • the first generation request of the page of the mini program may be a loading page for requesting generation of the mini program.
  • the sending the page data collection acquisition request to the server of the applet may specifically include: sending the page data collection acquisition request corresponding to the loaded page to the server of the applet, so that the terminal device can obtain the The page data set corresponding to the loaded page, and the page data set corresponding to the loaded page contains page data of the loaded page in multiple languages.
  • the determining the second page data of the page may specifically include: determining the second page data of the loading page from the page data set corresponding to the loading page obtained by the mobile terminal, and the first The language used in the second page data is the language indicated by the first language information.
  • the generating the page based on the second page data may specifically include: generating the loading page based on the second page data of the loading page.
  • the page data (ie metadata) in the loading page may include the applet Name, applet icon and applet description information, etc. Since the terminal device can store the page data of the loading page of the applet in multiple languages locally, at this time, it can be determined from the page data stored locally on the terminal device that it is the same language as the first language information of the host application and is the same as The page data (ie, the second page data) corresponding to the loading page of the applet is generated based on the second page data.
  • the generation based on the second page data since the determined language of the second page data of the loading page of the applet is the same as the language used by the host application (that is, the language indicated by the first language information), the generation based on the second page data
  • the loading page of the applet and the application page of the host application are presented in the same language, which is conducive to improving the user experience.
  • some terminal devices have an intelligent split screen function, that is, the application pages of multiple applications can be displayed on the terminal device at the same time.
  • the terminal device can display the application page of the host application and the applet launched in the host application at the same time Page.
  • the applet can automatically update the page of the applet after monitoring the change of the language information of the host application, so that the applet The language of the page is consistent with the language currently used by the host application.
  • step 206 based on the second page data, after the page is generated, it may further include:
  • the third page data of the page is determined, and the language used in the third page data is the language indicated by the second language information.
  • the page is updated.
  • the applet page generated in step 206 when the applet page generated in step 206 is displayed on the terminal device, after monitoring the change in the language used by the host application, the applet page can be automatically updated without the user's operation, so that the applet The language of the page data in the program page is consistent with the language currently used by the host application. It simplifies the operations that users need to perform when updating the applet page, which helps to improve the efficiency of updating the applet page, and also helps to improve the user experience.
  • the language information of the host application can be continuously monitored.
  • step 206 the mini program in step 202 is received again.
  • the page of the mini program mentioned in step 202 can be generated again based on the currently monitored language information of the host application.
  • step 206 after generating the page based on the second page data, it may further include: obtaining a second generation request for the page.
  • the fourth page data of the page is determined, and the language used in the fourth page data is the language indicated by the third language information.
  • the page is generated.
  • the third language information of the host application and the first language information of the host application may be the same or different.
  • the determined fourth page data of the page and the determined second page data of the page may be the same.
  • the third language information of the host application is different from the first language information, the determined fourth page data of the page and the determined second page data of the page use different languages, and then based on the first language information.
  • the language of the page generated by the four-page data and the page generated based on the second page data are also different.
  • the page generated based on the fourth page data is consistent with the language required to be presented on the application page of the current host application.
  • FIG. 4 is a schematic structural diagram of an apparatus for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification.
  • the device may include: a first obtaining module 402, configured to obtain a first generation request for a page of an applet, which is started in a host application; and a second obtaining module 404, To obtain the first language information of the host application, the first language information is used to indicate the language used by the first page data of the host application; the first determining module 406 is used to determine the second language of the page Page data, the language used by the second page data is the language indicated by the first language information; the first page generating module 408 is configured to generate the page based on the second page data.
  • the first determining module 406 may be specifically used to determine the second page data of the page from the page data set of the applet stored locally in the terminal device, and the terminal device is loaded with In the host application, the page data set includes page data corresponding to the page in multiple languages.
  • the device may further include: a first judgment module configured to judge whether the terminal device locally stores the page data set of the applet, and obtain the first judgment result.
  • a first judgment module configured to judge whether the terminal device locally stores the page data set of the applet, and obtain the first judgment result.
  • the first determining module 406 may specifically include: a page data collection acquiring unit, configured to send a notification to the terminal device when the first judgment result indicates that the terminal device does not store the page data collection of the applet locally
  • the server of the applet sends a page data collection acquisition request, so that the terminal device can obtain the page data collection of the applet.
  • the first generation request for the page of the applet may be used to request the generation of the applet.
  • the loading page of the program may be used to request the generation of the applet.
  • the page data collection obtaining unit may be specifically configured to send a page data collection obtaining request corresponding to the loading page to the server of the applet, so that the terminal device can obtain the page corresponding to the loading page A data set.
  • the page data set corresponding to the loaded page contains page data of the loaded page in multiple languages.
  • the first determining module 406 may further include: a second page data determining unit, configured to determine the second page of the loaded page from the set of page data corresponding to the loaded page obtained by the mobile terminal Data, the language used by the second page data is the language indicated by the first language information.
  • the first page generating module 408 is specifically configured to generate the loading page based on the second page data of the loading page.
  • the first determining module 406 may also be configured to obtain information from all the locally stored terminal device when the first determination result indicates that the terminal device locally stores the page data set of the applet. In the page data collection of the applet, the second page data of the page is determined.
  • the apparatus may further include: a fourth obtaining module, configured to obtain the second page data of the page from the page data set of the applet stored locally in the terminal device before determining the second page data of the page The first version information of the page data collection at the server of the applet.
  • a fourth obtaining module configured to obtain the second page data of the page from the page data set of the applet stored locally in the terminal device before determining the second page data of the page The first version information of the page data collection at the server of the applet.
  • the fifth obtaining module is configured to obtain the second version information of the page data set of the applet stored locally in the terminal device.
  • the second judgment module is used to judge whether the first version information is consistent with the second version information, and obtain a second judgment result.
  • the first determining module 406 may be specifically configured to obtain from the local storage of the terminal device when the second determination result indicates that the first version information is consistent with the second version information.
  • the second page data of the page is determined.
  • the first determining module 406 may also be used to obtain a page of the first version information from the server when the second determination result indicates that the first version information is inconsistent with the second version information Data collection; store the page data collection of the first version information locally to the terminal device; determine the second page data of the page from the page data collection of the first version information stored locally in the terminal device .
  • the first determining module 406 may be specifically used to obtain the second page data of the page from the server of the applet.
  • the device may further include: a monitoring module, configured to monitor the second language information after the language information of the host application has changed during the display of the page.
  • a monitoring module configured to monitor the second language information after the language information of the host application has changed during the display of the page.
  • the second determining module is configured to determine the third page data of the page, and the language used in the third page data is the language indicated by the second language information.
  • the page update module is configured to update the page based on the third page data.
  • the device may further include: a third obtaining module, configured to obtain a second generation request for the page.
  • a third obtaining module configured to obtain a second generation request for the page.
  • the fourth acquisition module is used to acquire the third language information of the host application.
  • the third determining module is configured to determine the fourth page data of the page, and the language used in the fourth page data is the language indicated by the third language information.
  • the second page generating module is configured to generate the page based on the fourth page data.
  • the embodiment of this specification also provides a device corresponding to the above method.
  • FIG. 5 is a schematic structural diagram of a device for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification.
  • the device 500 may include: at least one processor 510; and, a memory 530 communicatively connected to the at least one processor; wherein, the memory 530 stores data that can be executed by the at least one processor 510
  • the instruction 520 is executed by the at least one processor 510, so that the at least one processor 510 can: obtain the first generation request for the page of the applet, which is started in the host application of.
  • the second page data of the page is determined, and the language used in the second page data is the language indicated by the first language information.
  • the page is generated.
  • the improvement of a technology can be clearly distinguished between hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method flow).
  • hardware improvements for example, improvements in circuit structures such as diodes, transistors, switches, etc.
  • software improvements improvements in method flow.
  • the improvement of many methods and processes of today can be regarded as a direct improvement of the hardware circuit structure.
  • Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by the hardware entity module.
  • a programmable logic device for example, a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • ABEL Advanced Boolean Expression Language
  • AHDL Altera Hardware Description Language
  • HDCal JHDL
  • Lava Lava
  • Lola MyHDL
  • PALASM RHDL
  • VHDL Very-High-Speed Integrated Circuit Hardware Description Language
  • Verilog Verilog
  • the controller can be implemented in any suitable manner.
  • the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (such as software or firmware) executable by the (micro)processor. , Logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the memory control logic.
  • controllers in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded logic.
  • the same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
  • one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may adopt computer programs implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The form of the product.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM).
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • One or more embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

Abstract

A method, apparatus, and device for generating an applet page, the method for generating an applet page comprising: when a generation request for a page of an applet is received, first language information of a host application can be acquired, it is determined that the language used is the language indicated in the first language information and page data corresponding to the generation request of the page is determined so as to generate the page of the applet on the basis of the page data.

Description

一种小程序页面的生成方法、装置及设备Method, device and equipment for generating mini program page 技术领域Technical field
本说明书一个或多个实施例涉及计算机技术领域,尤其涉及一种小程序页面的生成方法、装置及设备。One or more embodiments of this specification relate to the field of computer technology, and in particular to a method, device, and device for generating a small program page.
背景技术Background technique
随着软件技术的快速发展,小程序得到了广泛的使用。小程序是一种不需要下载安装就可以使用的应用程序,用户可以在宿主应用上调用小程序,使用非常便捷。目前,由于宿主应用通常具有多种语言环境,使得用户可以根据实际需求控制宿主应用的页面数据所呈现的语种。但小程序的页面数据通常仅能以某种固定的语种进行呈现,无法与宿主应用的页面数据所呈现的语种保持一致,给用户使用小程序带来了不便。With the rapid development of software technology, small programs have been widely used. An applet is an application that can be used without downloading and installing. Users can call the applet on the host application, which is very convenient to use. At present, since the host application usually has multiple language environments, users can control the language presented by the page data of the host application according to actual needs. However, the page data of the applet can usually only be presented in a certain fixed language, which cannot be consistent with the language presented by the page data of the host application, which brings inconvenience to the user in using the applet.
综上所述,如何令小程序与宿主应用的页面数据所呈现的语种保持一致,已成为亟待解决的技术问题。In summary, how to keep the language presented in the page data of the applet and the host application consistent has become a technical problem to be solved urgently.
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供了一种小程序页面的生成方法、装置及设备,用于实现小程序对于App的语言环境的自适应,使得小程序与宿主应用的页面数据所呈现的语种保持一致。In view of this, one or more embodiments of this specification provide a method, device and device for generating applet pages, which are used to realize the adaptation of the applet to the language environment of the App, so that the applet and the host application’s page data The languages presented are consistent.
为解决上述技术问题,本说明书实施例是通过以下方面实现的。In order to solve the above technical problems, the embodiments of this specification are implemented through the following aspects.
本说明书实施例提供的一种小程序页面的生成方法,包括:获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;基于所述第二页面数据,生成所述页面。An embodiment of the present specification provides a method for generating an applet page, including: obtaining a first generation request for a page of an applet, the applet being started in a host application; obtaining the first language of the host application Information, the first language information is used to indicate the language used by the first page data of the host application; the second page data of the page is determined, and the language used by the second page data is the first language The language of the information; based on the second page data, the page is generated.
本说明书实施例提供的一种小程序页面的生成装置,包括:第一获取模块,用于获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;第二获取模块,用于获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;第一确定模块,用于确定所述页面的第二页面数据,所 述第二页面数据采用的语种为所述第一语种信息表示的语种;第一页面生成模块,用于基于所述第二页面数据,生成所述页面。An apparatus for generating an applet page provided by an embodiment of this specification includes: a first obtaining module, configured to obtain a first request for generating a page of an applet, the applet being started in a host application; and second The obtaining module is used to obtain the first language information of the host application, and the first language information is used to indicate the language used by the first page data of the host application; the first determining module is used to determine the page The language used in the second page data is the language indicated by the first language information; the first page generating module is configured to generate the page based on the second page data.
本说明书实施例提供的一种小程序页面的生成设备,包括:至少一个处理器;以及,The device for generating a small program page provided in an embodiment of this specification includes: at least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute The device can: obtain the first generation request for the page of the applet, the applet being started in the host application;
获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;基于所述第二页面数据,生成所述页面。Acquire the first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application; determine the second page data of the page, the second page data The language used is the language indicated by the first language information; the page is generated based on the second page data.
本说明书一个实施例实现了能够达到以下有益效果:通过在接收到针对小程序的页面的生成请求时,获取宿主应用的第一语种信息,并确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种,以基于所述第二页面数据,生成所述小程序的页面。在该方案中,由于可以确定出与宿主应用采用的语种相同的第二页面数据,并基于该第二页面数据生成小程序的页面,从而使得小程序与宿主应用的页面数据所呈现的语种保持一致,实现了小程序对于App的语言环境的自适应,有利于提升用户体验。An embodiment of the present specification achieves the following beneficial effects: by obtaining the first language information of the host application when a request for generating a page of the applet is received, and determining the second page data of the page, the first The language used in the second page data is the language indicated by the first language information, so as to generate the page of the applet based on the second page data. In this solution, the second page data in the same language as the host application can be determined, and the page of the applet is generated based on the second page data, so that the language presented by the page data of the applet and the host application remains Consistent, realizes the adaptation of the applet to the language environment of the App, which is beneficial to improve the user experience.
附图说明Description of the drawings
此处所说明的附图用来提供对本说明书一个或多个实施例的进一步理解,构成本说明书一个或多个实施例的一部分,本说明书的示意性实施例及其说明用于解释本说明书一个或多个实施例,并不构成对本说明书一个或多个实施例的不当限定。在附图中:The drawings described here are used to provide a further understanding of one or more embodiments of this specification, and constitute a part of one or more embodiments of this specification. The exemplary embodiments of this specification and their descriptions are used to explain one or more embodiments of this specification. The multiple embodiments do not constitute an improper limitation of one or more embodiments in this specification. In the attached picture:
图1为本说明书实施例提供的一种应用程序的应用页面示意图;FIG. 1 is a schematic diagram of an application page of an application program provided by an embodiment of this specification;
图2为本说明书实施例提供的一种小程序页面的生成方法的流程示意图;2 is a schematic flowchart of a method for generating a small program page provided by an embodiment of this specification;
图3为本说明书实施例提供的一种基于图2中的方法生成小程序的页面的示意图;FIG. 3 is a schematic diagram of a page of an applet generated based on the method in FIG. 2 according to an embodiment of the specification;
图4为本说明书实施例提供的对应于图2的一种小程序页面的生成装置的结构示意图;FIG. 4 is a schematic structural diagram of an apparatus for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification;
图5为本说明书实施例提供的对应于图2的一种小程序页面的生成设备的结构示意图。FIG. 5 is a schematic structural diagram of a device for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification.
具体实施方式Detailed ways
为使本说明书一个或多个实施例的目的、技术方案和优点更加清楚,下面将结合本说明书具体实施例及相应的附图对本说明书一个或多个实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本说明书一个或多个实施例保护的范围。In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with specific embodiments of this specification and the corresponding drawings. . Obviously, the described embodiments are only a part of the embodiments in this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of one or more embodiments of this specification.
以下结合附图,详细说明本说明书各实施例提供的技术方案。The technical solutions provided by the embodiments of this specification will be described in detail below with reference to the accompanying drawings.
现有技术中,宿主应用为部署于终端设备上的应用程序,用户可以通过触发宿主应用的应用页面中的小程序图标,以启动小程序。而小程序则是可以依托于宿主应用的应用程序运行且独立于宿主应用的应用程序而开发的网页结构框架程序。In the prior art, the host application is an application program deployed on a terminal device, and the user can activate the applet by triggering the applet icon on the application page of the host application. The applet is a webpage structure framework program that can be run by relying on the application of the host application and developed independently of the application of the host application.
目前,宿主应用通常具有多种语言环境,用户可以根据实际需求设定宿主应用当前的语言环境,以使得宿主应用的应用页面中的数据呈现为与用户设定的语言环境对应的语种,从而便于用户使用该宿主应用。但小程序的页面数据通常仅能以某种固定的语种进行呈现。At present, host applications usually have multiple language environments. Users can set the current language environment of the host application according to actual needs, so that the data in the application page of the host application is presented in the language corresponding to the language environment set by the user, so as to facilitate The user uses the host application. However, the page data of an applet can usually only be presented in a certain fixed language.
例如,图1为本说明书实施例提供的一种应用程序的应用页面示意图。如图1(a)所示,终端设备上显示有宿主应用的应用页面101,可见,该应用页面101中的页面数据“Mini Programs”使用的语种为英文。该应用页面101中还包含“电影”小程序图标102,“出租车”小程序图标103。当用户触发“出租车”小程序图标103之后,终端设备上会显示“出租车”小程序的应用页面。假定,小程序的页面数据仅能以简体中文进行呈现。则如图1(b)所示,“出租车”小程序的应用页面104中的页面数据“出租车”、“起点”、“终点”等所呈现的语种为简体中文。由于小程序与宿主应用的页面数据所呈现的语种无法保持一致,影响用户体验。For example, FIG. 1 is a schematic diagram of an application page of an application program provided in an embodiment of this specification. As shown in Figure 1(a), the application page 101 of the host application is displayed on the terminal device. It can be seen that the language used for the page data "Mini Programs" in the application page 101 is English. The application page 101 also contains a "movie" applet icon 102 and a "taxi" applet icon 103. After the user triggers the "taxi" applet icon 103, the terminal device will display the application page of the "taxi" applet. It is assumed that the page data of the applet can only be presented in simplified Chinese. As shown in FIG. 1(b), the language of the page data "taxi", "starting point", "destination" and so on in the application page 104 of the "taxi" applet is Simplified Chinese. Because the language presented by the page data of the applet and the host application cannot be consistent, the user experience is affected.
为了解决现有技术中的缺陷,本方案给出了以下实施例。In order to solve the defects in the prior art, this solution provides the following embodiments.
图2为本说明书实施例提供的一种小程序页面的生成方法的流程示意图。从程序角度而言,流程的执行主体可以为终端设备上运行的小程序。FIG. 2 is a schematic flowchart of a method for generating a small program page provided by an embodiment of this specification. From a program perspective, the execution subject of the process can be a small program running on a terminal device.
如图2所示,该流程可以包括以下步骤202至步骤208。As shown in FIG. 2, the process may include the following steps 202 to 208.
步骤202:获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的。Step 202: Obtain a first generation request for the page of the applet, the applet being started in the host application.
在本说明书实施例中,当用户触发小程序的图标,或者,触发小程序的应用页面中的部分按钮或者超链接时,小程序可以识别用户的触发操作,从而生成与该触发操作对应的页面的生成请求。该小程序是在宿主应用中启动的,该宿主应用搭载于终端设备中。In the embodiment of this specification, when the user triggers the icon of the applet, or part of the buttons or hyperlinks in the application page that triggers the applet, the applet can recognize the user's triggering operation, thereby generating a page corresponding to the triggering operation The build request. The applet is launched in the host application, and the host application is carried in the terminal device.
步骤204:获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种。Step 204: Obtain the first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application.
在本说明书实施例中,小程序可以通过监听宿主应用的语言环境,以获取所述宿主应用的第一语种信息,所述第一语种信息所表示的语种为当前所述宿主应用的应用页面中的数据所需呈现的语种。In the embodiment of this specification, the applet can obtain the first language information of the host application by monitoring the language environment of the host application, and the language indicated by the first language information is the current application page of the host application The language in which the data needs to be presented.
在实际应用中,宿主应用的语言环境一般指用户设置的宿主应用的页面数据所使用(或者所需呈现)的语种,例如,与宿主应用的语言环境对应的语种可以包括:简体中文、繁体中文、美国英语、泰语、印尼语、阿拉伯语等。用户可以根据实际需求设置宿主应用的语言环境,以使得宿主应用的页面数据所呈现的语种为与用户所设置的语言环境对应的语种。例如,假定,用户当前针对宿主应用设置的语言环境为en-US,则获取到的宿主应用的第一语种信息表示的语种可以为英文。In practical applications, the language environment of the host application generally refers to the language used (or required to be presented) in the page data of the host application set by the user. For example, the language corresponding to the language environment of the host application can include: simplified Chinese, traditional Chinese , American English, Thai, Indonesian, Arabic, etc. The user can set the language environment of the host application according to actual needs, so that the language presented by the page data of the host application is the language corresponding to the language environment set by the user. For example, assuming that the language environment currently set by the user for the host application is en-US, the acquired first language information of the host application may indicate English.
步骤206:确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种。Step 206: Determine the second page data of the page, and the language used in the second page data is the language indicated by the first language information.
在本说明书实施例中,当获取到宿主应用的第一语种信息时,为使得小程序与宿主应用的页面数据所呈现的语种保持一致,可以去确定与所述第一语种信息表示的语种相同且与步骤202中的页面生成请求对应的页面数据(即第二页面数据)。其中,页面数据可以包括页面中的文本信息(例如,标题、描述等信息)、图标信息、图片信息、超链接信息等。In the embodiment of this specification, when the first language information of the host application is obtained, in order to make the applet and the host application’s page data the same language, it can be determined that the language is the same as the first language information. And the page data (that is, the second page data) corresponding to the page generation request in step 202. Wherein, the page data may include text information (for example, title, description, etc.), icon information, picture information, hyperlink information, etc. in the page.
在本说明书实施例中,确定所述页面的第二页面数据的实现方式有多种。In the embodiment of this specification, there are multiple implementation ways for determining the second page data of the page.
第一种实现方式The first way to achieve
步骤206,具体可以包括:从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,所述终端设备上搭载有所述宿主应用,所述页面数据集合中包含多种语种的与所述页面对应的页面数据。Step 206 may specifically include: determining the second page data of the page from the page data set of the applet stored locally in the terminal device, the terminal device is loaded with the host application, and the page data set Contains page data corresponding to the page in multiple languages.
在本实现方式中,终端设备中可以存储有所述小程序的页面数据集合,该页面数据集合中的页面数据可以具有语种标识,该语种标识可以用于表示该页面数据所使用的语种,或者,该语种标识可以用于表示该页面数据在小程序页面中所需呈现的语种。从而, 可以从终端设备本地去获取既具有与所述第一语种信息表示的语种对应的语种标识,又与所述页面对应的页面数据作为第二页面数据。In this implementation, the terminal device may store the page data set of the applet, the page data in the page data set may have a language identifier, and the language identifier may be used to indicate the language used by the page data, or , The language identifier can be used to indicate the language that the page data needs to be presented in the applet page. Therefore, it is possible to obtain from the terminal device locally the language identifier corresponding to the language indicated by the first language information and the page data corresponding to the page as the second page data.
基于本实现方式确定所述页面中的第二页面数据时,速度较快,从而可以提升生成并展示与页面生成请求对应的小程序页面时的效率,减少用户的等待时间,以提升用户体验。When determining the second page data in the page based on this implementation manner, the speed is faster, which can improve the efficiency of generating and displaying the applet page corresponding to the page generation request, reduce the waiting time of the user, and improve the user experience.
第二种实现方式The second way to achieve
步骤206,具体可以包括:从所述小程序的服务器处获取所述页面的第二页面数据。Step 206 may specifically include: obtaining the second page data of the page from the server of the applet.
在本实现方式中,可以向小程序的服务器发送页面数据获取请求,该页面数据获取请求用于请求语种为所述第一语种信息表示的语种且与步骤202中页面的生成请求对应的页面数据(即第二页面数据)。在实际应用中,小程序的服务器中可以预先存储有该小程序的页面数据集合,该页面数据集合中可以包含有多种语种的页面数据。由于小程序服务器处的页面数据集合是预先生成的,可以便于对页面数据集合中的各个页面数据进行校准,因此,页面数据集合中的页面数据的准确性较高。当服务器接收到页面数据获取请求时,可以从预先存储的多种语种的页面数据中,确定出第二页面数据,并反馈至终端设备。In this implementation manner, a page data acquisition request can be sent to the server of the applet. The page data acquisition request is used to request page data whose language is the language indicated by the first language information and corresponds to the page generation request in step 202 (That is, the second page data). In practical applications, the server of the applet may pre-store the page data set of the applet, and the page data set may contain page data in multiple languages. Since the page data collection at the applet server is generated in advance, it is convenient to calibrate each page data in the page data collection. Therefore, the accuracy of the page data in the page data collection is relatively high. When the server receives the page data acquisition request, it can determine the second page data from the pre-stored page data in multiple languages, and feed it back to the terminal device.
该实现方式可以快速的确定出准确性较高的第二页面数据,且无需终端设备预先存储小程序的页面数据,从而可以减少对终端设备的存储空间的占用。This implementation manner can quickly determine the second page data with higher accuracy, and does not require the terminal device to pre-store the page data of the applet, thereby reducing the occupation of the storage space of the terminal device.
或者,小程序的服务器处也可以仅预先存储单个语种的页面数据,当接收到终端设备发送的页面数据获取请求时,若确定服务器处存储的页面数据使用的语种与第一语种信息表示的语种不同时,则可以对预先存储的与步骤202中页面的生成请求对应的页面数据进行翻译,以生成所述第二页面数据,并反馈至终端设备。Alternatively, the server of the applet may only pre-store the page data of a single language. When receiving the page data acquisition request sent by the terminal device, if it is determined that the language used by the page data stored at the server and the language indicated by the first language information When they are different, the pre-stored page data corresponding to the page generation request in step 202 can be translated to generate the second page data and feed it back to the terminal device.
基于该实现方式确定第二页面数据时,由于无需终端设备预先存储小程序的页面数据,从而可以减少对终端设备的存储空间的占用。且由于无需小程序的服务器处存储多种语种的页面数据,从而可以减少对该服务器的存储空间的占用。When the second page data is determined based on this implementation manner, since the terminal device does not need to pre-store the page data of the applet, the storage space of the terminal device can be reduced. And because the server that does not need a small program stores page data in multiple languages, the storage space of the server can be reduced.
在本说明书实施例中,所述页面的第二页面数据中既可以包含页面固定信息,也可以包含页面可变信息。其中,页面固定信息是指在不同时刻分别对所述页面进行展示时,所述页面中不发生变化的信息,例如,按钮描述信息,或者,部分标题信息等。所述页面可变信息,是指在不同时刻分别对所述页面进行展示时,所述页面中可以发生变化的信息,例如,新闻内容,用户个人数据等信息。In the embodiment of this specification, the second page data of the page may include fixed page information or variable page information. Wherein, page fixed information refers to information that does not change on the page when the page is displayed at different times, for example, button description information, or partial title information. The page variable information refers to information that can change on the page when the page is displayed at different times, for example, news content, user personal data and other information.
在实际应用时,为兼顾页面生成效率及页面数据的实时性,可以将页面固定信息预先存储于终端设备本地,以从终端设备本地获取该页面固定信息。而将页面可变信息存储于小程序的服务器,以从小程序的服务器处获取该页面可变信息。在本说明书实施例中,对于终端设备本地及小程序服务器处存储的页面数据的内容及类型并不再具体限定,小程序的维护人员可以根据实际需求自行设定。In actual applications, in order to take into account the page generation efficiency and the real-time nature of page data, the page fixed information may be stored locally in the terminal device in advance, so as to obtain the page fixed information locally from the terminal device. The page variable information is stored in the applet's server to obtain the page variable information from the applet's server. In the embodiments of this specification, the content and type of the page data stored locally on the terminal device and the applet server are not specifically limited, and the applet maintainer can set it by himself according to actual needs.
步骤208:基于所述第二页面数据,生成所述页面。Step 208: Generate the page based on the second page data.
在本说明书实施例中,所述小程序具有可执行代码(Executable Code),终端设备可以运行该小程序的可执行代码,以生成用于展示所述第二页面数据的页面,并将生成的所述页面展示于终端设备上。In the embodiment of this specification, the applet has executable code (Executable Code), and the terminal device can run the executable code of the applet to generate a page for displaying the data of the second page, and the generated The page is displayed on the terminal device.
具体的,所述小程序的可执行代码中无需预先嵌入所述小程序的页面数据,而是只需在运行所述小程序的可执行代码时,调用所述小程序的页面数据,即可生成所述小程序的页面。即所述小程序的可执行代码(或者用于生成可执行代码的源代码)中无需包含所述小程序的页面数据,而只需根据实际需求调用所需的页面数据即可。这不仅可以简化小程序的开发操作,也使得所述小程序的可执行程序在运行过程中,可以切换页面中的数据所使用的语种。由于无需停用该小程序,并对小程序的可执行代码(或者源代码)进行修改,即可切换小程序页面中的数据所使用的语种,有利于提升小程序的页面数据使用的语种进行切换时的效率,同时也有利于提升用户体验。Specifically, there is no need to embed the page data of the applet in the executable code of the applet in advance. Instead, it only needs to call the page data of the applet when the executable code of the applet is running. Generate the page of the applet. That is, the executable code of the applet (or the source code used to generate the executable code) does not need to include the page data of the applet, but only needs to call the required page data according to actual needs. This not only simplifies the development operation of the applet, but also enables the executable program of the applet to switch the language used by the data in the page during the running process of the applet. Since there is no need to stop the applet and modify the executable code (or source code) of the applet, you can switch the language used by the data in the applet page, which is helpful to improve the language of the page data of the applet. The efficiency of the handover is also conducive to improving the user experience.
图3为本说明书实施例提供的一种基于图2中的方法生成小程序的页面的示意图。如图3(a)所示,终端设备上显示有宿主应用的应用页面301,可见,该应用页面301中的页面数据“Mini Programs”使用的语种为英文。该应用页面101中还包含“电影”小程序图标302及“出租车”小程序图标303。由于“出租车”小程序图标303中的文字信息使用的语种为简体中文,可知“出租车”小程序开发时预设的初始语种为简体中文。当用户触发“出租车”小程序图标303之后,基于图2中的方法,终端设备上会显示“出租车”小程序的应用页面。如图3(b)所示,“出租车”小程序的应用页面304中的页面数据“Taxi”、“Start”、“End”等所使用的语种为英文。即基于图2中的方法生成的小程序的页面与宿主应用的页面所使用的语种相同。FIG. 3 is a schematic diagram of a page of an applet generated based on the method in FIG. 2 according to an embodiment of this specification. As shown in Figure 3(a), an application page 301 of the host application is displayed on the terminal device. It can be seen that the language used for the page data "Mini Programs" in the application page 301 is English. The application page 101 also includes a "movie" applet icon 302 and a "taxi" applet icon 303. Since the language of the text information in the icon 303 of the "taxi" applet is simplified Chinese, it can be known that the initial language preset during the development of the "taxi" applet is simplified Chinese. After the user triggers the "taxi" applet icon 303, based on the method in FIG. 2, the terminal device will display the application page of the "taxi" applet. As shown in Figure 3(b), the language used for the page data "Taxi", "Start", "End", etc. in the application page 304 of the "Taxi" applet is English. That is, the page of the applet generated based on the method in FIG. 2 and the page of the host application use the same language.
应当理解,本说明书一个或多个实施例所述的方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。It should be understood that the order of some of the steps of the method described in one or more embodiments of this specification can be exchanged according to actual needs, or some of the steps can also be omitted or deleted.
图2中的方法,可以确定出与小程序的页面的生成请求对应第二页面数据,且所述 第二页面数据使用的语种与宿主应用使用的语种相同,并基于该第二页面数据生成小程序的页面,使得小程序与宿主应用的页面数据所呈现的语种保持一致,实现了小程序对于宿主应用的语言环境的自适应,有利于提升用户体验。The method in FIG. 2 can determine the second page data corresponding to the page generation request of the applet, and the language of the second page data is the same as that of the host application, and the applet is generated based on the second page data. The page of the program keeps the language presented in the page data of the applet and the host application consistent, and realizes the adaptation of the applet to the language environment of the host application, which is conducive to improving the user experience.
基于图2的方法,本说明书实施例还提供了该方法的一些具体实施方案,下面进行说明。Based on the method in FIG. 2, the examples of this specification also provide some specific implementations of the method, which are described below.
在本说明书实施例中,针对步骤206的第一种实现方式,在从终端设备本地确定第二页面数据之前,可以先确定终端设备本地是否存储有小程序的页面数据集合,若是,则可以从终端设备本地确定第二页面数据。若否,则存在两种情况,第一种,终端设备本地曾经存储的小程序的页面数据集合被删除掉了;第二种,终端设备本地未曾存储过小程序的页面数据集合,即对应于用户第一次通过宿主应用启动小程序的场景;此时,需从小程序的服务器处下载小程序的页面数据集合,以从终端设备本地确定第二页面数据。In the embodiment of this specification, for the first implementation of step 206, before the second page data is determined locally from the terminal device, it can be determined whether the terminal device locally stores the page data set of the applet. The terminal device locally determines the second page data. If not, there are two situations. The first is that the page data collection of the applet stored locally on the terminal device is deleted; the second is that the page data set of the applet that has not been stored locally on the terminal device corresponds to A scenario where the user launches the applet through the host application for the first time; at this time, the page data collection of the applet needs to be downloaded from the server of the applet to determine the second page data locally from the terminal device.
因此,在从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据之前,还可以包括:判断所述终端设备本地是否存储有所述小程序的页面数据集合,得到第一判断结果。Therefore, in the page data set of the applet stored locally from the terminal device, before determining the second page data of the page, it may further include: determining whether the terminal device locally stores the page data of the applet Collect, get the first judgment result.
当所述第一判断结果表示所述终端设备本地存储有所述小程序的页面数据集合时,从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。When the first judgment result indicates that the terminal device locally stores the page data set of the applet, from the page data set of the applet stored locally on the terminal device, determine the second page of the page. Page data.
当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,向所述小程序的服务器发送页面数据集合获取请求,以便于所述终端设备获取到所述小程序的页面数据集合。进而可以从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。When the first judgment result indicates that the terminal device does not store the page data set of the applet locally, a page data set acquisition request is sent to the server of the applet, so that the terminal device can obtain the applet. The page data collection of the program. Furthermore, the second page data of the page can be determined from the page data collection of the applet stored locally in the terminal device.
在实际应用中,终端设备中的小程序的页面数据集合是从小程序的服务器处获取的。根据实际需求,小程序的服务器处的页面数据集合中的页面数据及页面数据的语种可能会发生变化。例如,小程序的服务器处的页面数据集合中可能会新增一种语种的页面数据。因此,为对包含的数据不同的页面数据集合进行区分,可以为各个包含的数据不同的页面数据集合设置不同的版本信息。In practical applications, the page data collection of the applet in the terminal device is obtained from the server of the applet. According to actual needs, the page data and the language of the page data in the page data collection at the server of the applet may change. For example, a new language page data may be added to the page data collection at the server of the applet. Therefore, in order to distinguish page data sets that contain different data, different version information can be set for each page data set that contains different data.
为确保终端设备处的页面数据集合的实时性,在从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据之前,还可以包括:In order to ensure the real-time performance of the page data collection at the terminal device, before determining the second page data of the page from the page data collection of the applet stored locally on the terminal device, it may further include:
获取所述小程序的服务器处的页面数据集合的第一版本信息。Obtain the first version information of the page data collection at the server of the applet.
获取终端设备本地存储的所述小程序的页面数据集合的第二版本信息。Obtain the second version information of the page data set of the applet stored locally on the terminal device.
判断该第一版本信息与该第二版本信息是否一致,得到第二判断结果。It is judged whether the first version information is consistent with the second version information, and a second judgment result is obtained.
当所述第二判断结果表示该第一版本信息与该第二版本信息一致时,从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。When the second judgment result indicates that the first version information is consistent with the second version information, the second page data of the page is determined from the page data set of the applet stored locally in the terminal device.
当所述第二判断结果表示该第一版本信息与该第二版本信息不一致时,从所述服务器处获取所述第一版本信息的页面数据集合。存储所述第一版本信息的页面数据集合至所述终端设备本地。以从所述终端设备本地存储的所述第一版本信息的页面数据集合中,确定所述页面的第二页面数据。When the second judgment result indicates that the first version information is inconsistent with the second version information, obtain the page data set of the first version information from the server. The page data storing the first version information is collected locally on the terminal device. The second page data of the page is determined from the page data set of the first version information stored locally in the terminal device.
在实际应用中,当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,针对用户第一次通过宿主应用启动小程序的场景,步骤202中的针对所述小程序的页面的第一生成请求可以为用于请求生成所述小程序的加载页面。In practical applications, when the first judgment result indicates that the terminal device does not store the page data collection of the applet locally, for the scenario where the user launches the applet through the host application for the first time, the step 202 is for all The first generation request of the page of the mini program may be a loading page for requesting generation of the mini program.
所述向所述小程序的服务器发送页面数据集合获取请求,具体可以包括:向所述小程序的服务器发送与所述加载页面对应的页面数据集合获取请求,以便于所述终端设备获取到与所述加载页面对应的页面数据集合,所述与所述加载页面对应的页面数据集合中包含多种语种的所述加载页面的页面数据。The sending the page data collection acquisition request to the server of the applet may specifically include: sending the page data collection acquisition request corresponding to the loaded page to the server of the applet, so that the terminal device can obtain the The page data set corresponding to the loaded page, and the page data set corresponding to the loaded page contains page data of the loaded page in multiple languages.
所述确定所述页面的第二页面数据,具体可以包括:从所述移动终端获取到的与所述加载页面对应的页面数据集合中,确定所述加载页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种。The determining the second page data of the page may specifically include: determining the second page data of the loading page from the page data set corresponding to the loading page obtained by the mobile terminal, and the first The language used in the second page data is the language indicated by the first language information.
所述基于所述第二页面数据,生成所述页面,具体可以包括:基于所述加载页面的第二页面数据,生成所述加载页面。The generating the page based on the second page data may specifically include: generating the loading page based on the second page data of the loading page.
在本说明书实施例中,当用户第一次通过宿主应用内的小程序入口启动小程序时,首先会进入小程序的加载页面,该加载页面中的页面数据(即元数据)可以包含小程序名称、小程序图标和小程序描述信息等。由于终端设备本地可以存储有多种语种的小程序的加载页面的页面数据,此时,可以从终端设备本地存储的页面数据中,确定出与宿主应用的第一语种信息表示的语种相同且与该小程序的加载页面对应的页面数据(即第二页面数据),基于该第二页面数据生成小程序的加载页面。In the embodiment of this specification, when the user launches the applet through the applet entry in the host application for the first time, he will first enter the loading page of the applet, and the page data (ie metadata) in the loading page may include the applet Name, applet icon and applet description information, etc. Since the terminal device can store the page data of the loading page of the applet in multiple languages locally, at this time, it can be determined from the page data stored locally on the terminal device that it is the same language as the first language information of the host application and is the same as The page data (ie, the second page data) corresponding to the loading page of the applet is generated based on the second page data.
在本说明书实施例中,由于确定出的小程序的加载页面的第二页面数据的语种与宿 主应用使用的语种(即第一语种信息表示的语种)相同,从而使得基于该第二页面数据生成的小程序的加载页面与宿主应用的应用页面所呈现的语种相同,有利于提升用户体验。In the embodiment of this specification, since the determined language of the second page data of the loading page of the applet is the same as the language used by the host application (that is, the language indicated by the first language information), the generation based on the second page data The loading page of the applet and the application page of the host application are presented in the same language, which is conducive to improving the user experience.
目前,部分终端设备具有智能分屏功能,即在终端设备上可以同时显示多个应用的应用页面,例如,终端设备上可以同时显示有宿主应用的应用页面及在该宿主应用中启动的小程序的页面。此时,若用户对宿主应用使用的语种进行了修改,为便于用户使用小程序,小程序可以在监听到宿主应用的语种信息发生变化后,对该小程序的页面进行自动更新,使得小程序页面的语种与宿主应用当前使用的语种保持一致。At present, some terminal devices have an intelligent split screen function, that is, the application pages of multiple applications can be displayed on the terminal device at the same time. For example, the terminal device can display the application page of the host application and the applet launched in the host application at the same time Page. At this time, if the user modifies the language used by the host application, in order to facilitate the user to use the applet, the applet can automatically update the page of the applet after monitoring the change of the language information of the host application, so that the applet The language of the page is consistent with the language currently used by the host application.
具体的,步骤206:基于所述第二页面数据,生成所述页面之后,还可以包括:Specifically, step 206: based on the second page data, after the page is generated, it may further include:
在所述页面的展示期间,监听所述宿主应用的语种信息发生变化后的第二语种信息。During the display of the page, monitor the second language information after the language information of the host application has changed.
确定所述页面的第三页面数据,所述第三页面数据采用的语种为所述第二语种信息表示的语种。The third page data of the page is determined, and the language used in the third page data is the language indicated by the second language information.
基于所述第三页面数据,更新所述页面。Based on the third page data, the page is updated.
在本说明书实施例中,在步骤206中生成的小程序页面显示于终端设备上时,当监测到宿主应用使用的语种发送变化后,无需用户执行操作,即可以自动更新小程序页面,使得小程序页面中的页面数据呈现的语种与宿主应用当前使用的语种保持一致。简化了更新小程序页面时用户所需执行的操作,有利于提升对小程序页面的更新效率,同时也有利于提升用户体验。In the embodiment of this specification, when the applet page generated in step 206 is displayed on the terminal device, after monitoring the change in the language used by the host application, the applet page can be automatically updated without the user's operation, so that the applet The language of the page data in the program page is consistent with the language currently used by the host application. It simplifies the operations that users need to perform when updating the applet page, which helps to improve the efficiency of updating the applet page, and also helps to improve the user experience.
在本说明书实施例中,在所述小程序运行期间(包括前台运行期间及后台运行期间),可以持续监听宿主应用的语种信息,当在执行步骤206之后,再次接收到针对步骤202中的小程序的页面的生成请求时,可以基于当前监听到的宿主应用的语种信息去再次生成步骤202中提及的小程序的页面。In the embodiment of this specification, during the running period of the applet (including the foreground running period and the background running period), the language information of the host application can be continuously monitored. After step 206 is executed, the mini program in step 202 is received again. When the program page is requested, the page of the mini program mentioned in step 202 can be generated again based on the currently monitored language information of the host application.
具体的,步骤206:基于所述第二页面数据,生成所述页面之后,还可以包括:获取针对所述页面的第二生成请求。Specifically, step 206: after generating the page based on the second page data, it may further include: obtaining a second generation request for the page.
获取所述宿主应用的第三语种信息。Obtain the third language information of the host application.
确定所述页面的第四页面数据,所述第四页面数据采用的语种为所述第三语种信息表示的语种。The fourth page data of the page is determined, and the language used in the fourth page data is the language indicated by the third language information.
基于所述第四页面数据,生成所述页面。Based on the fourth page data, the page is generated.
在本说明书实施例中,宿主应用的第三语种信息与宿主应用的第一语种信息既可以相同,也可以不同。当宿主应用的第三语种信息与第一语种信息相同时,确定出的所述页面的第四页面数据与确定出的所述页面的第二页面数据可以是相同的。而当宿主应用的第三语种信息与第一语种信息不同时,确定出的所述页面的第四页面数据与确定出的所述页面的第二页面数据使用的语种不同,进而基于所述第四页面数据生成的页面与基于所述第二页面数据生成的页面所呈现的语种也不同。但是,基于所述第四页面数据生成的页面与当前宿主应用的应用页面所需呈现的语种是保持一致的。In the embodiments of this specification, the third language information of the host application and the first language information of the host application may be the same or different. When the third language information of the host application is the same as the first language information, the determined fourth page data of the page and the determined second page data of the page may be the same. When the third language information of the host application is different from the first language information, the determined fourth page data of the page and the determined second page data of the page use different languages, and then based on the first language information. The language of the page generated by the four-page data and the page generated based on the second page data are also different. However, the page generated based on the fourth page data is consistent with the language required to be presented on the application page of the current host application.
可见,在本说明书实施例中,在所述小程序运行期间,当宿主应用采用的语种发送变化后,仍然可以使小程序的页面与宿主应用的页面使用的语种保持一致。由于无需停用该小程序,并对小程序的可执行代码(或者源代码)进行修改,即可切换小程序页面所使用的语种,有利于提升对小程序的页面使用的语种进行切换时的效率,也有利于提升用户体验。It can be seen that, in the embodiment of this specification, during the running of the applet, when the language used by the host application is changed, the language used by the page of the applet and the page of the host application can still be kept consistent. Since there is no need to deactivate the applet and modify the executable code (or source code) of the applet, you can switch the language used by the applet page, which is helpful to improve the language when switching the applet page Efficiency is also conducive to improving user experience.
基于同样的思路,本说明书实施例还提供了上述方法对应的装置。图4为本说明书实施例提供的对应于图2的一种小程序页面的生成装置的结构示意图。如图4所示,该装置可以包括:第一获取模块402,用于获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;第二获取模块404,用于获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;第一确定模块406,用于确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;第一页面生成模块408,用于基于所述第二页面数据,生成所述页面。Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method. FIG. 4 is a schematic structural diagram of an apparatus for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification. As shown in FIG. 4, the device may include: a first obtaining module 402, configured to obtain a first generation request for a page of an applet, which is started in a host application; and a second obtaining module 404, To obtain the first language information of the host application, the first language information is used to indicate the language used by the first page data of the host application; the first determining module 406 is used to determine the second language of the page Page data, the language used by the second page data is the language indicated by the first language information; the first page generating module 408 is configured to generate the page based on the second page data.
基于图4的装置,本说明书实施例还提供了该方法的一些具体实施方案,下面进行说明。Based on the device in FIG. 4, the examples of this specification also provide some specific implementations of the method, which are described below.
可选的,所述第一确定模块406,具体可以用于:从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,所述终端设备上搭载有所述宿主应用,所述页面数据集合中包含多种语种的与所述页面对应的页面数据。Optionally, the first determining module 406 may be specifically used to determine the second page data of the page from the page data set of the applet stored locally in the terminal device, and the terminal device is loaded with In the host application, the page data set includes page data corresponding to the page in multiple languages.
可选的,所述装置,还可以包括:第一判断模块,用于判断所述终端设备本地是否存储有所述小程序的页面数据集合,得到第一判断结果。Optionally, the device may further include: a first judgment module configured to judge whether the terminal device locally stores the page data set of the applet, and obtain the first judgment result.
对应的,所述第一确定模块406,具体可以包括:页面数据集合获取单元,用于当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,向所述 小程序的服务器发送页面数据集合获取请求,以便于所述终端设备获取到所述小程序的页面数据集合。Correspondingly, the first determining module 406 may specifically include: a page data collection acquiring unit, configured to send a notification to the terminal device when the first judgment result indicates that the terminal device does not store the page data collection of the applet locally The server of the applet sends a page data collection acquisition request, so that the terminal device can obtain the page data collection of the applet.
在实际应用中,当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,针对所述小程序的页面的第一生成请求可以用于请求生成所述小程序的加载页面。In practical applications, when the first judgment result indicates that the terminal device does not store the page data set of the applet locally, the first generation request for the page of the applet may be used to request the generation of the applet. The loading page of the program.
则所述页面数据集合获取单元,具体可以用于向所述小程序的服务器发送与所述加载页面对应的页面数据集合获取请求,以便于所述终端设备获取到与所述加载页面对应的页面数据集合,所述与所述加载页面对应的页面数据集合中包含多种语种的所述加载页面的页面数据。Then the page data collection obtaining unit may be specifically configured to send a page data collection obtaining request corresponding to the loading page to the server of the applet, so that the terminal device can obtain the page corresponding to the loading page A data set. The page data set corresponding to the loaded page contains page data of the loaded page in multiple languages.
所述第一确定模块406,还可以包括:第二页面数据确定单元,用于从所述移动终端获取到的与所述加载页面对应的页面数据集合中,确定所述加载页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种。The first determining module 406 may further include: a second page data determining unit, configured to determine the second page of the loaded page from the set of page data corresponding to the loaded page obtained by the mobile terminal Data, the language used by the second page data is the language indicated by the first language information.
对应的,所述第一页面生成模块408,具体用于基于所述加载页面的第二页面数据,生成所述加载页面。Correspondingly, the first page generating module 408 is specifically configured to generate the loading page based on the second page data of the loading page.
可选的,所述第一确定模块406,还可以用于在所述第一判断结果表示所述终端设备本地存储有所述小程序的页面数据集合时,从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。Optionally, the first determining module 406 may also be configured to obtain information from all the locally stored terminal device when the first determination result indicates that the terminal device locally stores the page data set of the applet. In the page data collection of the applet, the second page data of the page is determined.
可选的,所述装置还可以包括:第四获取模块,用于从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据之前,获取所述小程序的服务器处的页面数据集合的第一版本信息。Optionally, the apparatus may further include: a fourth obtaining module, configured to obtain the second page data of the page from the page data set of the applet stored locally in the terminal device before determining the second page data of the page The first version information of the page data collection at the server of the applet.
第五获取模块,用于获取所述终端设备本地存储的所述小程序的页面数据集合的第二版本信息。The fifth obtaining module is configured to obtain the second version information of the page data set of the applet stored locally in the terminal device.
第二判断模块,用于判断所述第一版本信息与所述第二版本信息是否一致,得到第二判断结果。The second judgment module is used to judge whether the first version information is consistent with the second version information, and obtain a second judgment result.
对应的,所述第一确定模块406,具体可以用于当所述第二判断结果表示所述第一版本信息与所述第二版本信息一致时,从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。Correspondingly, the first determining module 406 may be specifically configured to obtain from the local storage of the terminal device when the second determination result indicates that the first version information is consistent with the second version information. In the page data set of the program, the second page data of the page is determined.
所述第一确定模块406,还可以用于当所述第二判断结果表示所述第一版本信息与 所述第二版本信息不一致时,从所述服务器处获取所述第一版本信息的页面数据集合;存储所述第一版本信息的页面数据集合至所述终端设备本地;从所述终端设备本地存储的所述第一版本信息的页面数据集合中,确定所述页面的第二页面数据。The first determining module 406 may also be used to obtain a page of the first version information from the server when the second determination result indicates that the first version information is inconsistent with the second version information Data collection; store the page data collection of the first version information locally to the terminal device; determine the second page data of the page from the page data collection of the first version information stored locally in the terminal device .
可选的,所述第一确定模块406,具体可以用于:从所述小程序的服务器处获取所述页面的第二页面数据。Optionally, the first determining module 406 may be specifically used to obtain the second page data of the page from the server of the applet.
可选的,所述装置,还可以包括:监听模块,用于在所述页面的展示期间,监听所述宿主应用的语种信息发生变化后的第二语种信息。Optionally, the device may further include: a monitoring module, configured to monitor the second language information after the language information of the host application has changed during the display of the page.
第二确定模块,用于确定所述页面的第三页面数据,所述第三页面数据采用的语种为所述第二语种信息表示的语种。The second determining module is configured to determine the third page data of the page, and the language used in the third page data is the language indicated by the second language information.
页面更新模块,用于基于所述第三页面数据,更新所述页面。The page update module is configured to update the page based on the third page data.
可选的,所述装置还可以包括:第三获取模块,用于获取针对所述页面的第二生成请求。Optionally, the device may further include: a third obtaining module, configured to obtain a second generation request for the page.
第四获取模块,用于获取所述宿主应用的第三语种信息。The fourth acquisition module is used to acquire the third language information of the host application.
第三确定模块,用于确定所述页面的第四页面数据,所述第四页面数据采用的语种为所述第三语种信息表示的语种。The third determining module is configured to determine the fourth page data of the page, and the language used in the fourth page data is the language indicated by the third language information.
第二页面生成模块,用于基于所述第四页面数据,生成所述页面。The second page generating module is configured to generate the page based on the fourth page data.
基于同样的思路,本说明书实施例还提供了上述方法对应的设备。Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method.
图5为本说明书实施例提供的对应于图2的一种小程序页面的生成设备的结构示意图。如图5所示,设备500可以包括:至少一个处理器510;以及,与所述至少一个处理器通信连接的存储器530;其中,所述存储器530存储有可被所述至少一个处理器510执行的指令520,所述指令被所述至少一个处理器510执行,以使所述至少一个处理器510能够:获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的。FIG. 5 is a schematic structural diagram of a device for generating a small program page corresponding to FIG. 2 provided by an embodiment of this specification. As shown in FIG. 5, the device 500 may include: at least one processor 510; and, a memory 530 communicatively connected to the at least one processor; wherein, the memory 530 stores data that can be executed by the at least one processor 510 The instruction 520 is executed by the at least one processor 510, so that the at least one processor 510 can: obtain the first generation request for the page of the applet, which is started in the host application of.
获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种。Acquire the first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application.
确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种。The second page data of the page is determined, and the language used in the second page data is the language indicated by the first language information.
基于所述第二页面数据,生成所述页面。Based on the second page data, the page is generated.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished between hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method flow). However, with the development of technology, the improvement of many methods and processes of today can be regarded as a direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by the hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (for example, a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device. It is programmed by the designer to "integrate" a digital system on a piece of PLD, without requiring chip manufacturers to design and manufacture dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly realized with "logic compiler" software, which is similar to the software compiler used in program development and writing, but before compilation The original code must also be written in a specific programming language, which is called Hardware Description Language (HDL), and there is not only one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description), etc., currently most commonly used It is VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. It should also be clear to those skilled in the art that just a little bit of logic programming of the method flow in the above-mentioned hardware description languages and programming into an integrated circuit can easily obtain the hardware circuit that implements the logic method flow.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步 骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (such as software or firmware) executable by the (micro)processor. , Logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the memory control logic. Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded logic. The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本说明书一个或多个实施例时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various units and described separately. Of course, when implementing one or more embodiments of this specification, the functions of each unit may be implemented in the same one or more software and/or hardware.
本领域内的技术人员应明白,本说明书一个或多个实施例可提供为方法、系统、或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may adopt computer programs implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The form of the product.
本说明书一个或多个实施例是参照根据本说明书一个或多个实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。One or more embodiments of this specification are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to one or more embodiments of this specification. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带式磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, as for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
以上所述仅为本说明书的实施例而已,并不用于限制本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书一个或多个实施例的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例的权利要求范围之内。The above descriptions are only the embodiments of this specification, and are not used to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification should be included in the scope of the claims of one or more embodiments of this specification.

Claims (18)

  1. 一种小程序页面的生成方法,包括:A method for generating small program pages, including:
    获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;Acquiring the first generation request for the page of the applet, the applet being started in the host application;
    获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;Acquiring first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application;
    确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;Determining second page data of the page, where the language used by the second page data is the language indicated by the first language information;
    基于所述第二页面数据,生成所述页面。Based on the second page data, the page is generated.
  2. 如权利要求1所述的方法,所述确定所述页面的第二页面数据,具体包括:The method according to claim 1, wherein the determining the second page data of the page specifically includes:
    从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,所述终端设备上搭载有所述宿主应用,所述页面数据集合中包含多种语种的与所述页面对应的页面数据。Determine the second page data of the page from the page data set of the applet stored locally in the terminal device, the terminal device is loaded with the host application, and the page data set contains multi-language and The page data corresponding to the page.
  3. 如权利要求2所述的方法,所述从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据之前,还包括:3. The method according to claim 2, before determining the second page data of the page from the page data collection of the applet stored locally in the terminal device, the method further comprises:
    判断所述终端设备本地是否存储有所述小程序的页面数据集合,得到第一判断结果;Judging whether the terminal device locally stores the page data set of the applet, and obtaining a first judgment result;
    所述从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,具体包括:The determining the second page data of the page from the page data collection of the applet stored locally in the terminal device specifically includes:
    当所述第一判断结果表示所述终端设备本地存储有所述小程序的页面数据集合时,从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。When the first judgment result indicates that the terminal device locally stores the page data set of the applet, from the page data set of the applet stored locally on the terminal device, determine the second page of the page. Page data.
  4. 如权利要求3所述的方法,所述从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据之前,还包括:5. The method according to claim 3, before determining the second page data of the page from the page data collection of the applet stored locally in the terminal device, the method further comprises:
    获取所述小程序的服务器处的页面数据集合的第一版本信息;Acquiring the first version information of the page data collection at the server of the applet;
    获取所述终端设备本地存储的所述小程序的页面数据集合的第二版本信息;Acquiring the second version information of the page data set of the applet stored locally in the terminal device;
    判断所述第一版本信息与所述第二版本信息是否一致,得到第二判断结果;Judging whether the first version information is consistent with the second version information, and obtaining a second judgment result;
    所述从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,具体包括:The determining the second page data of the page from the page data collection of the applet stored locally in the terminal device specifically includes:
    当所述第二判断结果表示所述第一版本信息与所述第二版本信息一致时,从所述终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据。When the second judgment result indicates that the first version information is consistent with the second version information, determine the second page of the page from the page data set of the applet stored locally in the terminal device data.
  5. 如权利要求4所述的方法,所述判断所述第一版本信息与所述第二版本信息是否一致之后,还包括:The method according to claim 4, after determining whether the first version information is consistent with the second version information, the method further comprises:
    当所述第二判断结果表示所述第一版本信息与所述第二版本信息不一致时,从所述服务器处获取所述第一版本信息的页面数据集合;When the second judgment result indicates that the first version information is inconsistent with the second version information, acquiring the page data set of the first version information from the server;
    存储所述第一版本信息的页面数据集合至所述终端设备本地;Store the page data of the first version information locally to the terminal device;
    所述从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,具体包括:The determining the second page data of the page from the page data collection of the applet stored locally in the terminal device specifically includes:
    从所述终端设备本地存储的所述第一版本信息的页面数据集合中,确定所述页面的第二页面数据。Determine the second page data of the page from the page data set of the first version information stored locally in the terminal device.
  6. 如权利要求3所述的方法,所述判断所述终端设备本地是否存储有所述小程序的页面数据集合之后,还包括:The method according to claim 3, after determining whether the terminal device locally stores the page data collection of the applet, the method further comprises:
    当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,向所述小程序的服务器发送页面数据集合获取请求,以便于所述终端设备获取到所述小程序的页面数据集合。When the first judgment result indicates that the terminal device does not store the page data set of the applet locally, a page data set acquisition request is sent to the server of the applet, so that the terminal device can obtain the applet. The page data collection of the program.
  7. 如权利要求6所述的方法,当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,针对所述小程序的页面的第一生成请求用于请求生成所述小程序的加载页面;7. The method according to claim 6, when the first judgment result indicates that the terminal device does not store the page data set of the applet locally, the first generation request for the page of the applet is used to request generation The loading page of the mini program;
    所述向所述小程序的服务器发送页面数据集合获取请求,具体包括:The sending a page data collection acquisition request to the server of the applet specifically includes:
    向所述小程序的服务器发送与所述加载页面对应的页面数据集合获取请求,以便于所述终端设备获取到与所述加载页面对应的页面数据集合,所述与所述加载页面对应的页面数据集合中包含多种语种的所述加载页面的页面数据;Send the page data collection acquisition request corresponding to the loading page to the server of the applet, so that the terminal device can obtain the page data collection corresponding to the loading page, and the page corresponding to the loading page The data set contains page data of the loading page in multiple languages;
    所述确定所述页面的第二页面数据,具体包括:The determining the second page data of the page specifically includes:
    从所述移动终端获取到的与所述加载页面对应的页面数据集合中,确定所述加载页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;Determine the second page data of the loading page from the page data set corresponding to the loading page obtained by the mobile terminal, and the language used in the second page data is the language indicated by the first language information ;
    所述基于所述第二页面数据,生成所述页面,具体包括:The generating the page based on the second page data specifically includes:
    基于所述加载页面的第二页面数据,生成所述加载页面。The loading page is generated based on the second page data of the loading page.
  8. 如权利要求1所述的方法,所述确定所述页面的第二页面数据,具体包括:The method according to claim 1, wherein the determining the second page data of the page specifically includes:
    从所述小程序的服务器处获取所述页面的第二页面数据。Obtain the second page data of the page from the server of the applet.
  9. 如权利要求1所述的方法,所述基于所述第二页面数据,生成所述页面之后,还包括:The method according to claim 1, wherein after generating the page based on the second page data, the method further comprises:
    在所述页面的展示期间,监听所述宿主应用的语种信息发生变化后的第二语种信息;During the display of the page, monitor the second language information after the language information of the host application has changed;
    确定所述页面的第三页面数据,所述第三页面数据采用的语种为所述第二语种信息表示的语种;Determining third page data of the page, where the language used by the third page data is the language indicated by the second language information;
    基于所述第三页面数据,更新所述页面。Based on the third page data, the page is updated.
  10. 如权利要求1所述的方法,所述基于所述第二页面数据,生成所述页面之后,还包括:The method according to claim 1, wherein after generating the page based on the second page data, the method further comprises:
    获取针对所述页面的第二生成请求;Obtaining a second generation request for the page;
    获取所述宿主应用的第三语种信息;Acquiring third language information of the host application;
    确定所述页面的第四页面数据,所述第四页面数据采用的语种为所述第三语种信息表示的语种;Determining fourth page data of the page, where the language used by the fourth page data is the language indicated by the third language information;
    基于所述第四页面数据,生成所述页面。Based on the fourth page data, the page is generated.
  11. 一种小程序页面的生成装置,包括:A device for generating small program pages includes:
    第一获取模块,用于获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;The first obtaining module is configured to obtain the first generation request for the page of the applet, the applet being started in the host application;
    第二获取模块,用于获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;The second acquisition module is configured to acquire the first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application;
    第一确定模块,用于确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;The first determining module is configured to determine the second page data of the page, and the language used by the second page data is the language indicated by the first language information;
    第一页面生成模块,用于基于所述第二页面数据,生成所述页面。The first page generating module is configured to generate the page based on the second page data.
  12. 如权利要求11所述的装置,所述第一确定模块,具体用于:The apparatus according to claim 11, wherein the first determining module is specifically configured to:
    从终端设备本地存储的所述小程序的页面数据集合中,确定所述页面的第二页面数据,所述终端设备上搭载有所述宿主应用,所述页面数据集合中包含多种语种的与所述页面对应的页面数据。Determine the second page data of the page from the page data set of the applet stored locally in the terminal device, the terminal device is loaded with the host application, and the page data set contains multi-language and The page data corresponding to the page.
  13. 如权利要求12所述的方法,所述装置,还包括:The method according to claim 12, the device further comprising:
    第一判断模块,用于判断所述终端设备本地是否存储有所述小程序的页面数据集合,得到第一判断结果;The first judgment module is configured to judge whether the terminal device locally stores the page data set of the applet, and obtain the first judgment result;
    所述第一确定模块,具体包括:The first determining module specifically includes:
    页面数据集合获取单元,用于当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,向所述小程序的服务器发送页面数据集合获取请求,以便于所述终端设备获取到所述小程序的页面数据集合。The page data collection obtaining unit is configured to send a page data collection obtaining request to the server of the small program when the first judgment result indicates that the terminal device does not store the page data collection of the small program locally, so as to facilitate all The terminal device obtains the page data collection of the applet.
  14. 如权利要求13所述的装置,当所述第一判断结果表示所述终端设备本地未存储所述小程序的页面数据集合时,针对所述小程序的页面的第一生成请求用于请求生成所述小程序的加载页面;The apparatus according to claim 13, when the first judgment result indicates that the terminal device does not store the page data set of the applet locally, the first generation request for the page of the applet is used to request generation The loading page of the mini program;
    所述页面数据集合获取单元,具体用于向所述小程序的服务器发送与所述加载页面 对应的页面数据集合获取请求,以便于所述终端设备获取到与所述加载页面对应的页面数据集合,所述与所述加载页面对应的页面数据集合中包含多种语种的所述加载页面的页面数据;The page data collection obtaining unit is specifically configured to send a page data collection obtaining request corresponding to the loading page to the server of the applet, so that the terminal device can obtain the page data collection corresponding to the loading page , The page data set corresponding to the loading page includes page data of the loading page in multiple languages;
    所述第一确定模块,还包括:The first determining module further includes:
    第二页面数据确定单元,用于从所述移动终端获取到的与所述加载页面对应的页面数据集合中,确定所述加载页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;The second page data determining unit is configured to determine the second page data of the loading page from the page data set corresponding to the loading page obtained by the mobile terminal, and the language of the second page data is The language indicated by the first language information;
    所述第一页面生成模块,具体用于基于所述加载页面的第二页面数据,生成所述加载页面。The first page generating module is specifically configured to generate the loading page based on the second page data of the loading page.
  15. 如权利要求11所述的装置,所述第一确定模块,具体用于:The device according to claim 11, the first determining module is specifically configured to:
    从所述小程序的服务器处获取所述页面的第二页面数据。Obtain the second page data of the page from the server of the applet.
  16. 如权利要求11所述的装置,还包括:The apparatus of claim 11, further comprising:
    监听模块,用于在所述页面的展示期间,监听所述宿主应用的语种信息发生变化后的第二语种信息;The monitoring module is used to monitor the second language information after the language information of the host application has changed during the display of the page;
    第二确定模块,用于确定所述页面的第三页面数据,所述第三页面数据采用的语种为所述第二语种信息表示的语种;The second determining module is configured to determine the third page data of the page, and the language used in the third page data is the language indicated by the second language information;
    页面更新模块,用于基于所述第三页面数据,更新所述页面。The page update module is configured to update the page based on the third page data.
  17. 如权利要求11所述的装置,还包括:The apparatus of claim 11, further comprising:
    第三获取模块,用于获取针对所述页面的第二生成请求;The third obtaining module is configured to obtain the second generation request for the page;
    第四获取模块,用于获取所述宿主应用的第三语种信息;The fourth acquiring module is used to acquire the third language information of the host application;
    第三确定模块,用于确定所述页面的第四页面数据,所述第四页面数据采用的语种为所述第三语种信息表示的语种;The third determining module is configured to determine fourth page data of the page, and the language used by the fourth page data is the language indicated by the third language information;
    第二页面生成模块,用于基于所述第四页面数据,生成所述页面。The second page generating module is configured to generate the page based on the fourth page data.
  18. 一种小程序页面的生成设备,包括:A device for generating small program pages, including:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can:
    获取针对小程序的页面的第一生成请求,所述小程序是在宿主应用中启动的;Acquiring the first generation request for the page of the applet, the applet being started in the host application;
    获取所述宿主应用的第一语种信息,所述第一语种信息用于表示所述宿主应用的第一页面数据所使用的语种;Acquiring first language information of the host application, where the first language information is used to indicate the language used by the first page data of the host application;
    确定所述页面的第二页面数据,所述第二页面数据采用的语种为所述第一语种信息表示的语种;Determining second page data of the page, where the language used by the second page data is the language indicated by the first language information;
    基于所述第二页面数据,生成所述页面。Based on the second page data, the page is generated.
PCT/CN2020/132622 2020-01-16 2020-11-30 Method, apparatus, and device for generating applet page WO2021143371A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010048325.2A CN111240788A (en) 2020-01-16 2020-01-16 Method, device and equipment for generating small program page
CN202010048325.2 2020-01-16

Publications (1)

Publication Number Publication Date
WO2021143371A1 true WO2021143371A1 (en) 2021-07-22

Family

ID=70879494

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/132622 WO2021143371A1 (en) 2020-01-16 2020-11-30 Method, apparatus, and device for generating applet page

Country Status (2)

Country Link
CN (1) CN111240788A (en)
WO (1) WO2021143371A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023178924A1 (en) * 2022-03-24 2023-09-28 中国银联股份有限公司 Payment method, user terminal, apparatus, device, system, and medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240788A (en) * 2020-01-16 2020-06-05 支付宝(杭州)信息技术有限公司 Method, device and equipment for generating small program page
CN112416374B (en) * 2020-11-18 2022-10-25 北京字跳网络技术有限公司 Data processing method, device, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108681547A (en) * 2018-03-27 2018-10-19 厦门欣旅通科技有限公司 A kind of web content converting method and device based on small routine
US20190004829A1 (en) * 2017-06-29 2019-01-03 Guangzhou Uc Network Technology Co., Ltd. Method, device and user terminal for loading application
CN109918166A (en) * 2019-03-12 2019-06-21 天津字节跳动科技有限公司 Applet process method, apparatus and electronic equipment
CN109947433A (en) * 2019-03-28 2019-06-28 优信拍(北京)信息科技有限公司 A kind of generation method of small routine, update method and device
CN111240788A (en) * 2020-01-16 2020-06-05 支付宝(杭州)信息技术有限公司 Method, device and equipment for generating small program page

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172710A1 (en) * 2007-12-28 2009-07-02 Arman Toorians Method and system for enabling a mini program on a computing device to access an auxiliary system
CN101398845B (en) * 2008-11-05 2011-04-20 深圳市金蝶中间件有限公司 Multi-language binding method and system in web applications
CN106873971B (en) * 2016-12-29 2020-08-04 武汉斗鱼网络科技有限公司 Multi-language display method and system for flash application
CN108804175A (en) * 2018-05-21 2018-11-13 Oppo(重庆)智能科技有限公司 Multilingual adaptation method, mobile terminal and computer readable storage medium
CN109032717A (en) * 2018-06-15 2018-12-18 福建天晴数码有限公司 A kind of method and system updating interface display language
CN110597595B (en) * 2019-09-30 2020-09-25 腾讯科技(深圳)有限公司 Method for providing multi-language information, method for configuring multi-language information, device, equipment and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190004829A1 (en) * 2017-06-29 2019-01-03 Guangzhou Uc Network Technology Co., Ltd. Method, device and user terminal for loading application
CN108681547A (en) * 2018-03-27 2018-10-19 厦门欣旅通科技有限公司 A kind of web content converting method and device based on small routine
CN109918166A (en) * 2019-03-12 2019-06-21 天津字节跳动科技有限公司 Applet process method, apparatus and electronic equipment
CN109947433A (en) * 2019-03-28 2019-06-28 优信拍(北京)信息科技有限公司 A kind of generation method of small routine, update method and device
CN111240788A (en) * 2020-01-16 2020-06-05 支付宝(杭州)信息技术有限公司 Method, device and equipment for generating small program page

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023178924A1 (en) * 2022-03-24 2023-09-28 中国银联股份有限公司 Payment method, user terminal, apparatus, device, system, and medium

Also Published As

Publication number Publication date
CN111240788A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
WO2021143371A1 (en) Method, apparatus, and device for generating applet page
US11042276B2 (en) Instant-messaging-based picture sending method and device
WO2021197140A1 (en) Generation of applet file package
CN113259224B (en) Method and device for sending customer service data
CN110496395B (en) Component operation method, system and equipment for illusion engine
WO2019174394A1 (en) Image loading method and apparatus
US9760551B2 (en) Generating regular expression
WO2016110202A1 (en) Method, client and device for displaying page
WO2021223658A1 (en) Mini program update
WO2019179243A1 (en) Information display method, apparatus and device
WO2019192258A1 (en) Data synchronization method, device and apparatus
WO2019085653A1 (en) Page information display method, device, and client
CN107479868B (en) Interface loading method, device and equipment
EP3757739A1 (en) Method for display when exiting an application, and terminal
CN111796821A (en) Page updating method and device
US20220004404A1 (en) Application processing method and apparatus
CN114500421B (en) Message processing method and system
WO2021164368A1 (en) Container application starting method, system, and apparatus, and electronic device
CN111538667A (en) Page testing method and device
WO2019196548A1 (en) Data processing method, terminal device, and server
CN107885443B (en) Information processing method and device
CN114201086B (en) Information display method and device
US11210119B2 (en) Method and device for displaying interface, electronic equipment, server, and storage medium
CN112000329B (en) Data display method, device, equipment and medium
CN110018872A (en) A kind of PUSH message treating method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20914610

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20914610

Country of ref document: EP

Kind code of ref document: A1