Card Information Processing Method, Device, Equipment and Storage Medium
By generating replacement information and card information on the server device, the hardware resource consumption problem caused by the mobile terminal parsing and executing card code is solved, and the loading efficiency and operation speed of the mobile terminal are improved.
Patent Information
- Application Number
- CN202010893042.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-28
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2040-08-28
AI Technical Summary
When mobile terminals parse and execute card code, their running speed becomes slower due to limited hardware resources.
Replacement information and card information are generated on the server device according to the device context and card content of the terminal device, and card information is displayed on the terminal device by displaying instructions to avoid parsing and executing card codes on the mobile device.
It saves the hardware resources of mobile devices and improves the efficiency and operation speed of mobile terminals to load cards.
Smart Images

Figure CN114115867B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminals, and in particular, to a method, apparatus, device, and storage medium for processing card information. Background Art
[0002] When running an application on a mobile terminal such as a mobile phone or a tablet computer, it is often necessary to access content provided by a third party. For example, in a certain social application, weather information can be provided and displayed by a third party, or in a certain shopping application, the third party can provide and display advertisements based on the user's historical information. The accessed third-party content can be displayed in the form of a card.
[0003] In the prior art, a card in a user interface (UI) is implemented by sending the original card code to the mobile terminal and parsing and executing the card code in the mobile terminal.
[0004] However, due to limited hardware resources of the mobile terminal, a large amount of resources are consumed when parsing and executing the card code. As a result, the running speed of the mobile terminal becomes slower. Summary of the Invention
[0005] Embodiments of this application provide a method, apparatus, device, and storage medium for processing card information, which can improve the problem that a large amount of resources are consumed when parsing and executing card code on a mobile terminal, resulting in a slower running speed of the mobile terminal.
[0006] In a first aspect, an embodiment of this application provides a method for processing card information, which is applied to a server device and includes:
[0007] Receiving a target card acquisition request from a terminal device, where the target card acquisition request includes the device context of the terminal device and the card content to be acquired. Generating replacement information for the target card according to the device context, the card content to be acquired, and the card code corresponding to the card content to be acquired. Obtaining card information corresponding to the device context, where the card information is generated according to a first code segment corresponding to the device context in the card code. Sending a display instruction to the terminal device, where the display instruction is used for the terminal device to generate a target card according to the replacement information and the card information.
[0008] In some embodiments, the server device may be a device with computing capabilities such as a server or a cloud server.
[0009] Among them, the device context (DC) can be used to describe device characteristics, such as device model, engine version number, operating system (OS) version number, landscape / portrait orientation, height of the display area, width of the display area, device brand, theme, and other device parameters.
[0010] It should be noted that the card code is the original code provided by the developer. The layout, style, and referenced image resources, presented text, timer settings, event trigger responses, etc. of each UI element on the card can be described in text through scripting languages (JavaScript, JS), JavaScript Object Notation (JSON), YAML Ain't Markup Language (YAML), Cascading Style Sheets (CSS), etc.
[0011] The card content to be obtained is used to indicate the type of the target card and the content of the target card. For example, if a weather card for displaying weather information needs to be obtained, that is, the target card is a weather card. Then the card content to be obtained can be the identifier "queryWeather" of the weather card, or it can also be the text used to indicate querying the weather, such as "Check weather", "How's the weather in City A", etc. Or, it can also be a pre-set message code used to indicate querying the weather. For example, if the pre-set code "00001" is used to query the weather, then the card content to be obtained is "00001".
[0012] The first code snippet is obtained by performing logical branch pruning on the card code according to the device context. Only the logical branches related to the corresponding device context are retained in the first code snippet. After parsing, executing, etc. the first code snippet corresponding to each device context, card information corresponding to the device context can be generated. The card information can be a compiled card file or a fragment of the card file. Among them, multiple fragments of the card file can form a card file.
[0013] In a first aspect, first receive a target card acquisition request from a terminal device. The target card acquisition request includes the device context of the terminal device and the card content to be acquired. Then, according to the device context of the terminal device and the card content to be acquired, obtain the card information and the replacement information of the target card. Finally, send a display instruction to the terminal device. The display instruction is used for the terminal device to display the target card according to the card information and the replacement information. Among them, the card information corresponding to each device context is obtained according to the card code and the device context. The card information is obtained by logically branching and trimming the card code according to the device context to obtain a first code fragment, and then parsing and executing the first code fragment. Therefore, the card information only contains the card file or card file fragment related to the target card acquisition request. Since the card information is loaded on the server device, when the mobile device responds to the display instruction to display the target card, there is no need to parse and execute the card code on the mobile device, saving the hardware resources of the mobile device, improving the efficiency of the mobile terminal to load the card, and improving the running speed.
[0014] In some embodiments, obtaining the card information corresponding to the device context includes: determining, according to the device context of the terminal device, the card information corresponding to the device context of the terminal device in a pre-stored card information set. The card information set includes card information corresponding to at least one device context respectively, and the device context is one of the at least one device contexts.
[0015] In some embodiments, the device context includes device parameters. A second code fragment in the first code fragment is replaced by a preset replacement identifier. The second code fragment is used to determine the card feature value corresponding to the device parameters.
[0016] In a possible implementation manner, the card code includes a second code fragment. Before generating the card information, replace the second code fragment in the card code with a replacement identifier. According to the replaced card code and the device context, obtain the first code fragment. According to the first code fragment, generate the card information.
[0017] In another possible implementation manner, the first code fragment includes a second code fragment. Before generating the card information, replace the second code fragment in the first code fragment with a replacement identifier. According to the replaced first code fragment, generate the card information.
[0018] In some embodiments, the display instruction includes the download address of the card information and the replacement information. The download address is used to download the card information.
[0019] In some embodiments, the display instruction includes the card information and the replacement information.
[0020] Second aspect, embodiments of the present application provide a method for processing card information, which is applied to a terminal device and includes:
[0021] Sending a request for obtaining a target card to a server device, where the request for obtaining the target card includes the device context of the terminal device and the card content to be obtained. Receiving a display instruction from the server device. Obtaining replacement information and card information according to the display instruction. Generating a target card according to the replacement information and the card information.
[0022] In some embodiments, the terminal device may be a smart phone, a smart watch, a smart speaker with a screen, a tablet computer, a customized terminal with a screen, etc., which is not limited herein.
[0023] In the second aspect, the terminal device first sends a request for obtaining a target card to the server device, and then receives a display instruction from the server device. The display instruction is used for the terminal device to display the target card according to the card information and the replacement information. Finally, a target card is generated according to the display instruction. Since the card information is loaded on the server device, when the mobile device responds to the display instruction to display the target card, there is no need to parse, execute, and generate the card information on the mobile device, saving the hardware resources of the mobile device, improving the efficiency of the mobile terminal to load the card, and improving the running speed.
[0024] In some embodiments, generating a target card according to the replacement information and the card information includes: replacing the replacement information into the card information to obtain the replaced card information. Loading the replaced card information to generate a target card.
[0025] In some embodiments, the display instruction includes the download address of the card information and the replacement information.
[0026] Obtaining the replacement information and the card information according to the display instruction includes: extracting the replacement information and the download address of the card information in the display instruction. Downloading the card information according to the download address of the card information.
[0027] In some embodiments, the display instruction includes the card information and the replacement information.
[0028] Obtaining the replacement information and the card information according to the display instruction includes: extracting the replacement information and the card information in the display instruction.
[0029] In some embodiments, the card information includes a replacement identifier, and the replacement information includes a characteristic value of the replacement identifier.
[0030] Replacing the replacement information into the card information to obtain the replaced card information includes: replacing the replacement identifier in the card information with the characteristic value in the replacement information.
[0031] In a third aspect, an embodiment of the present application provides a card information processing device, which is applied to a server device and includes:
[0032] A receiving module, configured to receive a target card acquisition request from a terminal device, where the target card acquisition request includes the device context of the terminal device and the card content to be acquired. A generating module, configured to generate replacement information for the target card according to the device context, the card content to be acquired, and a card code corresponding to the card content to be acquired. An obtaining module, configured to obtain card information corresponding to the device context, where the card information is generated according to a first code segment corresponding to the device context in the card code. A sending module, configured to send a display instruction to the terminal device, where the display instruction is used for the terminal device to generate the target card according to the replacement information and the card information.
[0033] In some embodiments, the obtaining module is specifically configured to determine, according to the device context of the terminal device, card information corresponding to the device context of the terminal device in a pre-stored card information set, where the card information set includes card information corresponding to at least one device context respectively, and the device context is one of the at least one device contexts.
[0034] In some embodiments, the device context includes device parameters, and a second code segment in the first code segment is replaced by a preset replacement identifier, and the second code segment is used to determine a card feature value corresponding to the device parameters.
[0035] In a possible implementation, the card code includes a second code segment. The device further includes a replacement module, configured to replace the second code segment in the card code with a replacement identifier before generating the card information.
[0036] Correspondingly, the obtaining module is specifically configured to obtain the first code segment according to the replaced card code and the device context. Generate card information according to the first code segment.
[0037] In another possible implementation, the first code segment includes a second code segment. The replacement module is further configured to replace the second code segment in the first code segment with a replacement identifier before generating the card information.
[0038] Correspondingly, the obtaining module is specifically configured to generate card information according to the replaced first code segment.
[0039] In some embodiments, the display instruction includes a download address of the card information and the replacement information, and the download address is used to download the card information.
[0040] In some embodiments, the display instruction includes the card information and the replacement information.
[0041] Fourthly, an embodiment of the present application provides a card information processing device applied to a terminal device, including:
[0042] A sending module, configured to send a acquisition request of a target card to a server device, where the acquisition request of the target card includes the device context of the terminal device and the card content to be acquired. A receiving module, configured to receive a display instruction from the server device. An acquisition module, configured to acquire replacement information and card information according to the display instruction. A generation module, configured to generate a target card according to the replacement information and the card information.
[0043] In some embodiments, the generation module is specifically configured to replace the replacement information into the card information to obtain the replaced card information. Load the replaced card information to generate a target card.
[0044] In some embodiments, the display instruction includes the download address of the card information and the replacement information.
[0045] The acquisition module is specifically configured to extract the replacement information and the download address of the card information in the display instruction. Download the card information according to the download address of the card information.
[0046] In some embodiments, the display instruction includes the card information and the replacement information. The acquisition module is specifically configured to extract the replacement information and the card information in the display instruction.
[0047] In some embodiments, the card information includes a replacement identifier, and the replacement information includes a feature value of the replacement identifier. The generation module is specifically configured to replace the replacement identifier in the card information with the feature value in the replacement information.
[0048] Fifthly, an embodiment of the present application provides a server device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method provided in the first aspect is implemented.
[0049] Sixthly, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method provided in the second aspect is implemented.
[0050] Seventhly, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method provided in the first aspect is implemented.
[0051] Eighthly, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method provided in the second aspect is implemented.
[0052] In a ninth aspect, an embodiment of the present application provides a chip system, which includes a memory and a processor. The processor executes a computer program stored in the memory to implement the method provided in the first aspect.
[0053] In a tenth aspect, an embodiment of the present application provides a chip system, which includes a memory and a processor. The processor executes a computer program stored in the memory to implement the method provided in the second aspect.
[0054] In an eleventh aspect, an embodiment of the present application provides a chip system, which includes a processor. The processor is coupled to the computer-readable storage medium provided in the fifth aspect. The processor executes a computer program stored in the computer-readable storage medium to implement the method provided in the first aspect.
[0055] In a twelfth aspect, an embodiment of the present application provides a chip system, which includes a processor. The processor is coupled to the computer-readable storage medium provided in the sixth aspect. The processor executes a computer program stored in the computer-readable storage medium to implement the method provided in the second aspect.
[0056] It can be understood that for the beneficial effects of the above third aspect to the twelfth aspect, reference can be made to the relevant descriptions in the first aspect and the second aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 Schematic diagram of an application scenario of the card information processing method provided in an embodiment of the present application;
[0058] Figure 2 Schematic diagram of the structure of a mobile device provided in an embodiment of the present application;
[0059] Figure 3 Schematic diagram of the structure of a server device provided in an embodiment of the present application;
[0060] Figure 4 Schematic diagram of the process of the card information processing method provided in an embodiment of the present application;
[0061] Figure 5 Schematic diagram of the process of the card information processing method provided in another embodiment of the present application;
[0062] Figure 6 Schematic diagram of the process of the card information processing method provided in another embodiment of the present application;
[0063] Figure 7 Schematic diagram of the structure of the card information processing device applied to the server device provided in an embodiment of the present application;
[0064] Figure 8Schematic structural diagram of a card information processing device applied to a server device provided by another embodiment of the present application;
[0065] Figure 9 Schematic structural diagram of a card information processing device applied to a terminal device provided by an embodiment of the present application;
[0066] Figure 10 Schematic structural diagram of a mobile device provided by an embodiment of the present application;
[0067] Figure 11 Schematic structural diagram of a server device provided by an embodiment of the present application. Detailed implementation manners
[0068] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0069] It should be understood that the term "and / or" as used in the specification and claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0070] As used in the specification and claims of the present application, the term "if" can be interpreted as "when...", "once", "in response to determining", or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if detected" can be interpreted as meaning "once determined", "in response to determining", "once detected", or "in response to detecting" according to the context.
[0071] In addition, in the description of the specification and claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0072] References to "one embodiment" or "some embodiments" in the description of this application mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants mean "including but not limited to", unless otherwise specifically emphasized.
[0073] Figure 1 FIG. shows an application scenario of a possible card information processing method provided by this application.
[0074] In this scenario, it includes a mobile device 1 and a server device 2. Among them, the mobile device is shown in the form of a smart phone 1 in this scenario. The mobile device can also be a smart watch, a tablet computer, a smart speaker with a screen, a customized terminal with a screen, etc. The server device is shown in the form of a server 2 in this scenario. The server device can also be a device with computing power such as a cloud server. The specific forms of the mobile device and the server device are not limited in this application.
[0075] Reference Figure 1 , the smart phone can be connected to the Internet through a wireless network, and then communicate with the server 2. The smart phone responds to the user's operation and determines the target card to be displayed according to the user operation. Then it sends a target card acquisition request to the server. The server responds to this request, sends a display instruction to the mobile device, and the mobile device displays the target card according to the display instruction.
[0076] It should be noted that a card is a UI interface in an application that loads and displays the content provided by a third-party content provider through the engine of the application. A card can be a part of the UI interface of an application. For example, reference Figure 1 , in the desktop application of the smart phone, 2 cards are shown. Among them, the news card 11 obtains news content related to the located city according to the location of the smart phone and displays it on the news card. The time card 12, on the other hand, displays the current time information, such as date, week, time, and lunar calendar information. At the same time, it can also display local weather information, etc. according to the location. There are also various forms of cards. For example, a card can also be a search box for searching, a display interface for displaying advertisement information, a map interface for navigation, etc. The form of the card is not limited here.
[0077] The following is combined with Figure 2Specifically introduce each component and module of the terminal device:
[0078] The processor 110 is the control center of the terminal device. It can connect various parts of the terminal device through various interfaces and circuits. By running or executing software programs and / or modules stored in the storage module 150, and by invoking data stored in the storage module 150, it executes various functions of the terminal device and processes data.
[0079] In some embodiments, the processor 110 may include one or more processing units. For example, it may be a Central Processing Unit (CPU), or it may also be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0080] In still other embodiments, the processor 110 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 110, and this application does not limit this.
[0081] The vibration motor 111 can vibrate when receiving a signal to give a reminder in the form of vibration.
[0082] The input module 112 can be used to receive input information and key signals. The input information includes digital or character information, touch information, etc., and the key signals include the pressing signals of physical keys, the pressing signals of virtual keys, etc.
[0083] In one implementation, the input module 112 may include a touch panel and other input devices. The touch panel and the screen 130 may form a touch screen. The touch panel can collect touch operations of a user thereon or nearby (such as operations of a user using an object or accessory capable of generating a touch signal on the touch panel, such as a finger, a stylus, etc., on the touch panel or near the touch screen), and drive and execute corresponding functions according to a preset program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 110. The processor 110 receives the sent contact coordinates, converts them into touch commands and executes them. Multiple types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel. The other input devices may include one or more of, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, and a joystick.
[0084] The audio module 120 is configured to process audio signals. For example, the audio module 120 may convert the analog audio signal received by the microphone 123 into digital audio data and send it to the processor 110. Alternatively, it may convert the digital audio data sent by the processor 110 into an analog signal that can be played by the speaker 121 and the receiver 122 and send it to the speaker 121 or the receiver 122.
[0085] The screen 130 is used to visually output and display the content output by the terminal device. For example, it can display the information input by the user, display the information provided to the user, display the system interface of the terminal device, and the interface of the application program running on the terminal device, etc. The material of the display panel of the screen 130 may be a liquid crystal display (LCD), a thin film transistor (TFT), a light-emitting diode (LED), an organic light-emitting diode (OLED), etc., which is not limited herein.
[0086] In some implementations, the touch panel may cover the display panel of the screen. After the touch panel detects a touch operation thereon or nearby, it transmits the operation to the processor 110 to determine the type of the touch event. Subsequently, the processor 110 provides corresponding visual output on the display panel according to the type of the touch event. Although Figure 1The middle screen and the touch panel (not shown) are two independent components to implement the input and output functions of the mobile phone. However, in some embodiments, the touch panel can be integrated with the display panel to implement the input and output functions of the mobile phone. Among them, when the touch panel is integrated with the screen, it can be used as a touch screen. The touch screen can receive the touch signal on the touch panel and feedback it to the processor 110. The processor 110 responds according to the touch signal and displays the result after the response through the display panel of the screen.
[0087] The camera module 140 includes at least one camera, and the camera can be a front camera 141 or a rear camera 142.
[0088] For example only, the terminal device can be a single camera, a dual camera, a triple camera or a quadruple camera. For example, when it is a quadruple camera, one camera is the front camera 141 and three are the rear cameras 142. The three rear cameras 142 can be cameras with different focal lengths. Such as a main camera with an equivalent focal length of 35mm, a wide-angle camera with an equivalent focal length of 20mm, and a telephoto camera with an equivalent focal length of 105mm. The embodiments of the present application do not limit this.
[0089] It should be noted that when the terminal device includes multiple cameras, these multiple cameras can all be front-facing, or all be rear-facing, or a part be front-facing and another part be rear-facing. The embodiments of the present application do not limit this.
[0090] Among them, the storage module 150 includes an internal memory 151 and an external memory interface 152. The internal memory 151 can be a flash memory, a hard disk, an operating memory, etc. For example, the internal memory can include at least one hard disk or flash memory and one operating memory. The external memory interface 152 is used to connect to an external memory, and the external memory can include a memory card, a mobile hard disk, a USB flash drive, an optical disc, etc.
[0091] The storage module 150 can be used to store software programs and modules. The processor 110 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the storage module 150. The storage module 150 mainly includes a storage program area and a storage data area. Among them, the storage program area is usually located on the internal memory 151 and can store an operating system and application programs required for at least one function (such as a sound playback function and a touch response function). The storage data area can be located on the internal memory 151, or on an external memory connected to the external memory interface 152, or on both the internal memory and the external memory. The storage data area can store data created according to the use of the mobile phone (such as audio data, image data, video data).
[0092] The interface 160 includes, but is not limited to, a Subscriber Identity Module (SIM) card interface 161, a USB interface 162, and a headphone interface 163. The SIM card interface is used to insert a SIM card provided by a carrier, so that when the terminal device communicates with a base station through the mobile communication module 191, it can identify and verify the user's identity, and after passing the verification, send a call request, a data request, and receive calls, data, text messages, etc. forwarded by the base station.
[0093] The USB interface 162 can connect the terminal device to a computer through a USB data cable for data exchange. At the same time, the USB interface 162 is also connected to the power module 170. When the USB data cable is plugged into a computer or a charging socket, it can transmit the input electrical energy to the power module 170 to charge the terminal device. Among them, the USB interface 162 can be a micro-USB, a mini-USB, a USB Type-c, etc., which is not limited here.
[0094] The headphone interface 163 is used to connect a headphone. The headphone interface 163 can be an independent interface. For example, the headphone interface 163 can be a 3.5 mm headphone jack. Or, the headphone interface 163 can also be integrated into the USB interface 162. For example, the headphone interface can be integrated in the USB Type-c. When a headphone is inserted into the headphone interface 163, the audio module 120 can no longer send the output analog audio signal to the speaker 121 or the receiver 122, but send it to the headphone through the headphone interface 163 to play the audio through the headphone. When a headphone is inserted, if it is detected that the headphone does not include a microphone, the audio module still receives the analog audio signal sent by the microphone 123 at this time. If it is detected that the headphone includes a microphone, the audio module receives the analog audio signal sent by the headphone microphone, processes it and sends it to the processor 110.
[0095] The terminal device also includes a power module 170 that supplies power to each component. The power module can include a battery, a power management module, etc. The power management module can be logically connected to the processor 110, so as to realize functions such as managing the charging, discharging, and power consumption management of the battery through the power management module.
[0096] The terminal device may further include a sensor module 180. The sensor module includes at least one sensor, such as a pressure sensor 181, a gyro sensor 182, a distance sensor 183, a proximity light sensor 184, a touch sensor 185, or an acceleration sensor 186, etc. Among them, the proximity light sensor 184 may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 141 according to the brightness of the ambient light. The proximity sensor can turn off the display panel and / or the backlight of the screen 130 when the mobile phone is moved to the ear. As a kind of motion sensor, the acceleration sensor 186 can detect the magnitude of acceleration in all directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used to identify the posture of the terminal device (such as picking up or putting down the terminal device, placing the terminal device horizontally or vertically, etc.). It can also be used to identify related actions through vibration (such as step counting, tapping), etc. Other sensors of the terminal device will not be elaborated here.
[0097] The communication module 190 includes a mobile communication module 191 and a wireless communication module 192. The mobile communication module 191 can support any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Time-Division WCDMA (TD-WCDMA), Time-Division LTE (TD-LTE), the 5th generation New Radio (5G NR), etc. The wireless communication module 192 can support Bluetooth, Wireless Fidelity (Wi-Fi), Near Field Communication (NFC), etc.
[0098] The mobile communication module 191 can be used to connect to a communication base station through an antenna to establish a call link between the terminal device and other terminal devices and receive call audio. The wireless communication module 192 is used to wirelessly connect to an external call device. The external call device can be an external device with functions of playing and receiving sounds, such as a Bluetooth headset or a Bluetooth speaker. When the external call device is connected to the terminal device through the wireless communication module 192, the audio can be played through the external call device, and the analog audio signal collected by the external call device can be received, processed and sent to the processor 110.
[0099] The following combines Figure 3 to specifically introduce each component and module of the server device:
[0100] Figure 3 In this case, the processor 210 is the control center of the server device and can connect various parts of the server device through various interfaces and lines. By running or executing the software programs and / or modules stored in the storage module 230, and by calling the data stored in the storage module 230, it executes various functions of the server device and processes data.
[0101] In some embodiments, the processor 210 may include one or more processing units. For example, generally speaking, the processor 210 of the server device is a server CPU. The server CPU can be divided into a Complex Instruction Set Computing (CISC)-type CPU, a Reduced Instruction Set Computing (RISC)-type CPU, or a Very Long Instruction Word (VLIW)-type CPU according to the instruction set. This application does not limit the type of CPU of the server device.
[0102] The screen 220 is used to visually output and display the content output by the server device. For example, it can display the information input by the user, display the information provided to the user, display the system interface of the server device, and the interfaces of application programs running on the terminal device, etc. The material of the display panel of the screen 130 can be a Liquid Crystal Display (LCD), a Thin Film Transistor (TFT), a Light-Emitting Diode (LED), an Organic Light-Emitting Diode (OLED), etc., which is not limited here.
[0103] The storage module 230 can be used to store software programs and modules. The processor 210 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the storage module 150. The storage module 150 mainly includes a program storage area and a data storage area. Among them, the program storage area is usually located on the internal memory 231 and can store an operating system and application programs required for at least one function (such as a sound playback function and a touch response function). The data storage area can be located on the internal memory 231, or on an external memory connected to the external memory interface 232, or on both the internal memory and the external memory. The data storage area can store data created according to the use of the server device (such as audio data, image data, video data, cache data).
[0104] The input module 240 can be used to receive input information and key signals. The input information includes digital or character information, touch information, etc. The key signals include pressing signals of physical keys, pressing signals of virtual keys, etc.
[0105] In one implementation, the input module 240 may include a touch panel, a keyboard, a mouse, and other input devices. The touch panel can be set separately or combined with the screen 220 to form a touch screen. The touch panel can collect touch operations of the user on or near it (such as operations of the user using an object or accessory that can generate a touch signal on the touch panel, such as a finger or a stylus, on the touch panel or near the touch screen), and execute corresponding functions according to a preset program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and the signal brought by the touch operation, and transmits the signal to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 210. The processor 210 receives the sent contact coordinates, converts them into touch commands and executes them. Various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel.
[0106] The communication module 250 can include a wired communication module 251 and a wireless communication module 252. The server device can be connected to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), etc. through the wired communication module 251.
[0107] The wireless communication module 252 can support wireless communication methods such as Bluetooth and Wireless Fidelity (Wi-Fi). The server device can be connected to a Wireless Local Area Network (LAN) through the wireless communication module 252.
[0108] The server device also includes a power supply module 260 that powers each component. The power supply module can be a switching power supply, such as an Advanced Technology Extended (ATX) power supply or a Server System Infrastructure (SSI) power supply, etc., which is not limited here.
[0109] The interface 270 can include a Universal Serial Bus (USB) interface, a serial interface, a parallel interface, a power cord interface, a network cable interface, etc. The types of interfaces can also include more, such as an audio interface, a video output interface, a video input interface, etc., which are not limited in this application.
[0110] In the existing technology, the cards in the UI are implemented by sending the original card code to the mobile terminal and parsing and executing the card code in the mobile terminal. However, due to the large number of logical branches in the original card code, for example, the original code has targeted logical branches for features in the device context such as the brand, theme, landscape / portrait of the mobile terminal, so that the cards displayed on the mobile terminal can match the features in the device context of the mobile terminal and have a good visual effect. However, due to the limited hardware resources of the mobile terminal, when parsing and executing the original card code, a large amount of resources will be consumed for each logical branch operation. This will cause the running speed of the mobile terminal to slow down.
[0111] In response to this, this application provides a method for processing card information to improve the problem that a large amount of resources are consumed when parsing and executing card code on a mobile terminal, resulting in a slow running speed of the mobile terminal.
[0112] Figure 4 The schematic flowchart of the method for processing card information provided by this application is shown. This method can be applied to the above-mentioned server device.
[0113] Refer to Figure 4 , this method includes:
[0114] S31. Receive a target card acquisition request from the terminal device.
[0115] Among them, the target card acquisition request includes the device context of the terminal device and the card content to be acquired. The card information corresponding to each device context is obtained according to the card code and the preset device context. The card code includes a first code segment, and the first code segment is used to generate the card information. The device context (Device Context, DC) can be used to describe device characteristics, such as device model (Model), engine version number, operating system (OperatingSystem, OS) version number, landscape / portrait, display area height, display area width, device brand (Brand), theme (Theme), and other device parameters.
[0116] It should be noted that the card content to be acquired is used to indicate the type of the target card and the content of the target card. For example, if it is necessary to acquire a weather card for displaying weather information, that is, the target card is a weather card. Then the card content to be acquired can be the identifier "queryWeather" of the weather card, or it can also be the text used to indicate querying the weather, such as "Check weather", "How about the weather in City A", etc. Or, it can also be a pre-set message code used to indicate querying the weather. For example, if the pre-set code "00001" is used to query the weather, then the card content to be acquired is "00001". The card content to be acquired only needs to clearly indicate the acquisition of the card content, and its form is not restricted.
[0117] S32. Generate replacement information for the target card according to the device context, the card content to be acquired, and the card code corresponding to the card content to be acquired.
[0118] It should be noted that the replacement information includes at least one position to be replaced in the card information, and the replacement content corresponding to each position to be replaced. For example, if the target card is used to display weather information, the card information should include the code for acquiring weather information. The result obtained when this code is executed is the weather information, and the position of the execution result of this code is the position to be replaced. Correspondingly, the replacement content corresponding to the position to be replaced is the weather information obtained according to the target card acquisition request and the card code.
[0119] S33. Obtain the card information corresponding to the device context.
[0120] Among them, the card information is generated according to the first code segment corresponding to the device context in the card code.
[0121] It should be noted that the card code is the original code provided by the developer, and the layout, style of each UI element on the card, as well as the referenced image resources, presented text, timer settings, event trigger responses, etc. can be described in text through scripting languages (JavaScript, JS), JavaScript Object Notation (JSON), Another Markup Language (YAML), Cascading Style Sheets (CSS), etc.
[0122] The first code snippet is obtained by logically branching and trimming the card code according to the device context. Only the logical branches related to the corresponding device context are retained in the first code snippet. After parsing, executing, etc. the first code snippet corresponding to each device context, card information corresponding to the device context can be generated. The card information can be a compiled card file or a snippet of the card file, where multiple snippets of the card file can form a card file.
[0123] In some embodiments, the card code can generate a card that matches the terminal device when facing different terminal devices. By preprocessing the card code according to the device context, the logical branches irrelevant to the device context in the card code can be removed to obtain the first code snippet that matches the device context, and then the card information corresponding to the device context can be generated based on the first code snippet.
[0124] Among them, the card information can be obtained by processing the card code on the server device through the received device context.
[0125] Alternatively, the card information is obtained by matching in the pre-stored card information set according to the received device context, where the card information set includes card information corresponding to at least one device context respectively, and the received device context is one of the at least one device contexts. The card information set is generated by preprocessing the card code on the server device through a preset device context.
[0126] As an example, referring to Table 1, Table 1 shows part of the card code and the first code snippet obtained by processing part of the card code for a preset device context. Assume that in the preset device context, the device brand included is brand A, the theme is dark, and the display area height is 300 pixels.
[0127] Table 1
[0128]
[0129]
[0130] As can be seen from Table 1, the first code snippet obtained after logical branch pruning only includes logical branches related to the preset device context, and the code complexity is significantly reduced. When parsing and processing it, the number of operations can be reduced, saving operation time.
[0131] It should be noted that after obtaining the first code snippet, the first code snippet can be parsed to generate card information corresponding to the preset device context and stored in the server device in the form of a card file, thereby obtaining a card information set. Each card information in the card information set corresponds to a device context. Each card information in the card information set corresponds to a download address, and through this download address, the corresponding card information can be downloaded to the mobile device.
[0132] Referring to Table 2, Table 2 gives an example of a card information set, and the card information is stored in the server device in the form of a card file.
[0133] Table 2
[0134] Brand Theme Display Area Height Card File brand A Default 300 card_xxx_brandA_default_300.hpl brand A Default 600 card_xxx_brandA_default_600.hpl brand A Dark 300 card_xxx_brandA_dark_300.hpl brand A Dark 600 card_xxx_brandA_dark_600.hpl brand B Default 300 card_xxx_brandB_default_300.hpl brand B Default 600 card_xxx_brandB_default_600.hpl brand B Dark 300 card_xxx_brandB_dark_300.hpl brand B Dark 600 card_xxx_brandB_dark_600.hpl
[0135] Referring to Table 2, when sending a display instruction to the terminal device according to the target card acquisition request, the card code, the preset device context, and the card information corresponding to each device context. First, the device context of the terminal device included in the target card acquisition request can be used to match the corresponding card file in Table 2. For example, if the device context of the terminal device is that the device brand is brand A, the theme is dark, and the display area height is 300 pixels, then the card file card_xxx_brandA_dark_300.hpl can be determined in Table 2 as the card information that the target card acquisition request needs to obtain. The display instruction sent by the server device to the terminal device may include the download address of the card file card_xxx_brandA_dark_300.hpl or the card file itself.
[0136] S34. Send a display instruction to the terminal device.
[0137] Among them, the display instruction is used for the terminal device to generate a target card according to the replacement information and the card information. In this embodiment, the card information is obtained by logically branching and trimming the card code according to the device context to obtain the first code fragment, and then parsing and executing the first code fragment. Therefore, the card information only contains the card file or card file fragment related to the target card acquisition request. Since the card information is pre-loaded on the server device, when the mobile device responds to the display instruction to display the target card, there is no need to parse and execute the card code on the mobile device, saving the hardware resources of the mobile device, improving the efficiency of the mobile terminal to load the card, and improving the running speed.
[0138] Correspondingly, Figure 5 Fig. shows a schematic flowchart of another method for processing card information provided by the present application. This method can be applied to the above terminal device.
[0139] Referring to Figure 5 , the method includes:
[0140] S41. Send a target card acquisition request to the server device.
[0141] Among them, the target card acquisition request includes the device context of the terminal device and the card content to be acquired.
[0142] It should be noted that the device context of the terminal device can be obtained through the application programming interface (API) provided by the operating system on the terminal device.
[0143] As an example, the card content to be acquired can be the information input by the user. For example, if the target card is used to display the navigation route on the map, the card content to be acquired can be the text information of the navigation start point and the navigation end point input by the user, such as "How to get from City A to City B".
[0144] Or, the card content to be acquired can also be the information of a preset type obtained by the application. For example, if the target card is used to display weather information, the card content to be acquired can be the geographical location information obtained by the weather application according to the positioning, or the card identifier "queryWeather" of the weather card.
[0145] Or, the card content to be acquired can also be obtained by analyzing the user's historical behavior. For example, if the target card is used to display advertisement information, the card content to be acquired can be the advertisement information analyzed according to the user's historical browsing record. For example, if the high-frequency browsing content in the user's historical browsing record includes "mobile phone", "computer", etc., then "mobile phone advertisement", "computer advertisement" can be used as the card content to be acquired.
[0146] S42. Receive a display instruction from the server device.
[0147] Among them, the display instruction is used to instruct the terminal device to display a target card according to the card information and replacement information. The replacement information is generated by the server device according to the device context, the card content to be obtained, and the card code corresponding to the target card. The card information is generated by the server device according to the first code segment corresponding to the device context in the card code.
[0148] S43. Obtain the replacement information and the card information according to the display instruction.
[0149] In some embodiments, the display instruction may include the download address of the card information and the replacement information. When obtaining the replacement information and the card information according to the display instruction, the replacement information and the download address of the card information in the display instruction can be extracted first. Then, the card information is downloaded according to the download address of the card information.
[0150] In other embodiments, the display instruction may include the card information and the replacement information. When obtaining the replacement information and the card information, the replacement information and the card information in the display instruction can be directly extracted.
[0151] S44. Generate a target card according to the replacement information and the card information.
[0152] In this embodiment, the display instruction is used for the terminal device to generate a target card according to the card information and the replacement information.
[0153] Since the card information is loaded on the server device and the replacement information is also obtained on the server device. Therefore, when the mobile device responds to the display instruction to display the target card, there is no need to parse, execute, and generate the card information for the card code on the mobile device, saving the hardware resources of the mobile device, improving the efficiency of the mobile terminal to load the card, and improving the running speed.
[0154] Figure 6 The illustrated embodiment combines a method for processing card information applied to a mobile device and a server device, and gives an application process of a method for processing card information.
[0155] Such as Figure 6 , the method includes:
[0156] S501. The mobile device generates a target card acquisition request.
[0157] In some embodiments, the target card acquisition request may be generated in response to a user operation or may be generated by the mobile device regularly. For example, refer to Figure 1In the interface of a smart phone, when a click operation on the icon corresponding to "Application 1" is received, Application 1 is launched. If Application 1 contains at least one target card, a target card acquisition request corresponding to each target card is generated. Or, referring to Figure 1 , for news cards, a target card acquisition request can be sent to the server device once every preset time to obtain updated target cards and provide the latest news content.
[0158] S502. The mobile device sends the target card acquisition request to the server device.
[0159] Among them, the target card acquisition request sent by the mobile device is similar to that in S41 and will not be elaborated here.
[0160] S503. The server device generates replacement information for the target card according to the device context, the card content to be acquired, and the card code corresponding to the target card.
[0161] In some embodiments, the device context of the terminal device and the card content to be acquired can be used as variables, input into the card code for processing to obtain the replacement information for the target card. The replacement information for the target card is the same as that in S32 and will not be elaborated here.
[0162] S504. The server device generates card information corresponding to the device context according to the first code segment corresponding to the device context in the card code.
[0163] In some embodiments, referring to S33 and Table 2, in the server device, the first code segment corresponding to each preset device context can be determined in the card code in advance, and then the card information corresponding to each device context is generated. And the obtained multiple pre-loaded card information is stored in the memory of the server device as a card information set, and each card information in the card information set corresponds to a device context.
[0164] Then, after receiving the target card acquisition request, the server device compares the device context of the mobile device in it with the device context corresponding to each card information in the card information set pre-stored in the server. If it is determined that there is a device context in the device context corresponding to the card information that is the same as the device context of the mobile device, the card information corresponding to the device context is used as the card information of the target card. For example, if the device context of the mobile device is that the device brand is brand B, the theme is dark, and the display area height is 600 pixels, then referring to Table 2, it can be determined that the card file card_xxx_brandB_dark_600.hpl is the card information of the target card.
[0165] In another possible implementation, in the server device, no device context identical to that of the mobile device can be matched. This indicates that all the preprocessed card information does not match the mobile device. In this case, the card code can be used as the card information of the target card to ensure that the mobile device can load the card normally. Alternatively, in the server device, the card code can be directly processed according to the device context of the mobile device to obtain a first code snippet, and then the card information of the target card can be obtained. There is no limitation here.
[0166] S505. The server device generates a display instruction according to the replacement information of the target card and the card information corresponding to the device context.
[0167] In some implementations, when the server device generates a display instruction, it can first obtain the download address of the card information, and then package the download address and the replacement information to generate a display instruction.
[0168] S506. The server device sends the display instruction to the mobile device.
[0169] S507. The mobile device downloads the card information according to the download address of the card information.
[0170] In some implementations, when the mobile device downloads the card information, it can accelerate the download through a Content Delivery Network (CDN) to ensure that the mobile device can quickly download the card information under different network conditions.
[0171] S508. The mobile device replaces the replacement information into the card information to obtain the replaced card information.
[0172] In some implementations, referring to S504, the replacement information of the target card includes at least one position to be replaced in the target card and the replacement content corresponding to each position to be replaced. The mobile device replaces each replacement content into the corresponding position to be replaced, and then the replaced card information can be obtained.
[0173] S509. The mobile device loads the replaced card information and displays the target card.
[0174] In this embodiment, the card information is obtained by performing logical branch trimming on the card code according to the device context to obtain a first code snippet and then parsing and executing the first code snippet. Therefore, the card information only contains the card files or card file snippets related to the target card acquisition request. Since the card information is pre-loaded on the server device, when the mobile device responds to the display instruction to display the target card, there is no need to parse and execute the card code on the mobile device, saving the hardware resources of the mobile device, improving the efficiency of the mobile terminal to load the card, and increasing the running speed.
[0175] In some other embodiments, the card information can be further streamlined by replacing identifiers.
[0176] Among them, the device context includes device parameters, and the card code includes a second code segment. The second code segment is used to determine the card feature value corresponding to the device parameters.
[0177] In a possible implementation, the card code includes a second code segment. Before generating the card information, the second code segment in the piece code is replaced with a replacement identifier. According to the replaced card code and the device context, a first code segment is obtained. According to the first code segment, the card information is generated.
[0178] In another possible implementation, the first code segment includes a second code segment. Before generating the card information, the second code segment in the first code segment is replaced with a replacement identifier. According to the replaced first code segment, the card information is generated.
[0179] Then, when the mobile device requests the target card, the feature value of the replacement identifier calculated according to the card code and the target card is obtained, and the feature value of the replacement identifier is used as part of the replacement information of the target card, and is packaged with the download address of the card information replaced with the replacement identifier to generate a display instruction and sent to the mobile device.
[0180] After receiving the above display instruction, the mobile device downloads the card information replaced with the replacement identifier, and then replaces it according to the replacement information including the feature value of the replacement identifier, and loads and generates the target card.
[0181] Table 3 shows an example of using a replacement identifier to replace the second code segment for determining the card feature value according to the device parameters. Among them, as an example, the device parameter can be the device model (os.model). Correspondingly, the card feature value is the font color of the card. However, the device model is only an example of the device parameters. In practical applications, each device parameter in the device context can be replaced with a replacement identifier, or only some of the device parameters can be replaced, which is not limited here.
[0182] Table 3
[0183]
[0184]
[0185] Referring to Table 3, the server device receives a target card acquisition request, which includes the device context of the terminal device and the card content to be acquired. If in the device context received by the server device, os.model == 222, the card information determined according to the device context is card_yyy_replace_template.hpl.
[0186] Then, the server device generates a display instruction according to the card content to be acquired and the device context of the terminal device. Among them, the display instruction may include: the download address of the card card_yyy_replace_template.hpl, and the replacement information of the target card. For example, the display instruction may be the instruction shown in Table 4:
[0187] Table 4
[0188]
[0189] Referring to Table 4, according to the card download address https: / / www.example.com / card_yyy_replace_template.hpl, the card card_yyy_replace_template.hpl can be downloaded, that is, the first code snippet after replacement using the replacement identifier in Table 3. The replacement information of the target card includes the feature value corresponding to the replacement identifier: "TIPS_COLOR": "green".
[0190] Then, replace the replacement information of the target card into the card information after replacement using the replacement identifier to obtain the code in Table 5. Running this code can display the text color as green. Among them, ${TIPS_COLOR} is the position to be replaced, and "TIPS_COLOR": "green" is the replacement content.
[0191] Table 5
[0192]
[0193] In this embodiment, by using a replacement identifier to replace the second code snippet that determines the card feature value in the card code or the first code snippet according to device parameters, the code length can be effectively streamlined and the logical branches can be reduced. Then, in the server device, according to the card code and the target card acquisition request, the feature value corresponding to the replacement identifier is calculated and used as part of the replacement information of the target card, which is packaged in the display instruction. When the mobile device loads and generates the target card according to the display instruction, the feature value corresponding to the replacement identifier is replaced into the card information, and then the target card can be loaded. Since the replacement identifier is used, there is no need to perform the calculation of logical branches on the mobile device, and only replacement is required, which effectively reduces the resource occupancy of the mobile device and improves the card loading speed.
[0194] In some other embodiments, when generating the card information, the first code snippet can also be compiled into bytecode or machine code corresponding to the device model in the device context according to the device model in the device context, and then stored in the server device as the card information. This can further reduce the resources consumed when the mobile device loads the card information and improve the card loading speed.
[0195] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution is prior or subsequent. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0196] Corresponding to the card information processing method applied to the server device provided in the above embodiments, Figure 7 The structural block diagram of the card information processing device applied to the server device provided by the embodiments of the present application is shown. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown.
[0197] Refer to Figure 7 and the device includes:
[0198] A receiving module 61, configured to receive a target card acquisition request from a terminal device, where the target card acquisition request includes the device context of the terminal device and the card content to be acquired.
[0199] A generating module 62, configured to generate replacement information of the target card according to the device context, the card content to be acquired, and the card code corresponding to the card content to be acquired.
[0200] An acquiring module 63, configured to acquire the card information corresponding to the device context, where the card information is generated according to the first code snippet corresponding to the device context in the card code.
[0201] A sending module 64, configured to send a display instruction to the terminal device, where the display instruction is used for the terminal device to generate a target card according to the replacement information and the card information.
[0202] In some embodiments, the obtaining module 63 is specifically configured to determine, according to the device context of the terminal device, the card information corresponding to the device context of the terminal device from a pre-stored set of card information, where the set of card information includes card information corresponding to at least one device context respectively, and the device context is one of at least one device contexts.
[0203] In some embodiments, the device context includes device parameters, and the second code snippet in the first code snippet is replaced by a preset replacement identifier, and the second code snippet is used to determine the card feature value corresponding to the device parameters.
[0204] In a possible implementation, the card code includes the second code snippet. Refer to Figure 8 , and the device further includes a replacement module 65, configured to replace the second code snippet in the card code with the replacement identifier before generating the card information.
[0205] Correspondingly, the obtaining module 63 is specifically configured to obtain the first code snippet according to the replaced card code and the device context. Generate card information according to the first code snippet.
[0206] In another possible implementation, the first code snippet includes the second code snippet. The replacement module 65 is further configured to replace the second code snippet in the first code snippet with the replacement identifier before generating the card information.
[0207] Correspondingly, the obtaining module 63 is specifically configured to generate card information according to the replaced first code snippet.
[0208] In some embodiments, the display instruction includes the download address of the card information and the replacement information, and the download address is used to download the card information.
[0209] In some embodiments, the display instruction includes the card information and the replacement information.
[0210] Corresponding to the method for processing card information applied to a terminal device provided in the foregoing embodiment, Figure 9 The structure block diagram of the device for processing card information applied to a terminal device provided in the embodiment of the present application is shown. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown.
[0211] Refer to Figure 9 , the device includes:
[0212] A sending module 71, configured to send a request for obtaining a target card to a server device, where the request for obtaining the target card includes the device context of the terminal device and the card content to be obtained.
[0213] A receiving module 72 for receiving a display instruction from a server device.
[0214] An obtaining module 73 for obtaining replacement information and card information according to the display instruction.
[0215] A generating module 74 for generating a target card according to the replacement information and the card information.
[0216] In some embodiments, the generating module 74 is specifically configured to replace the replacement information into the card information to obtain the replaced card information, and load the replaced card information to generate a target card.
[0217] In some embodiments, the display instruction includes a download address of the card information and replacement information.
[0218] The obtaining module 73 is specifically configured to extract the replacement information and the download address of the card information in the display instruction, and download the card information according to the download address of the card information.
[0219] In some embodiments, the display instruction includes card information and replacement information.
[0220] The obtaining module 73 is specifically configured to extract the replacement information and the card information in the display instruction.
[0221] In some embodiments, the card information includes a replacement identifier, and the replacement information includes a feature value of the replacement identifier. The generating module 74 is specifically configured to replace the replacement identifier in the card information with the feature value in the replacement information.
[0222] It should be noted that for the information interaction, execution process, etc. between the above modules, since they are based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought thereby can be specifically referred to the method embodiment part, and will not be elaborated herein.
[0223] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example for illustration. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, and will not be elaborated herein.
[0224] Figure 10 This is a schematic structural diagram of a server device provided by an embodiment of the present application. As Figure 10 shown, the server device 800 of this embodiment includes: at least one processor 801 ( Figure 10 only one is shown in the figure), a processor, a memory 802, and a computer program 803 stored in the memory 802 and executable on at least one processor 801. When the processor 801 executes the computer program 803, the steps in the above-described embodiment of the card information processing method applied to the server device are implemented.
[0225] The server device 800 may be a server, such as a desktop server, a rack server, a cabinet server, a blade server, and other computing devices. The server device may include, but is not limited to, a processor 801 and a memory 802. Those skilled in the art can understand that Figure 10 merely examples of the server device 800 do not constitute a limitation on the server device 800, and may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0226] The so-called processor 801 may be a central processing unit (CPU), and the processor 801 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0227] The memory 802 may be an internal storage unit of the server device 800 in some embodiments, such as the hard disk or memory of the server device 800. The memory 802 may also be an external storage device of the server device 800 in other embodiments, such as a plug-in hard disk equipped on the server device 800, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 802 may also include both the internal storage unit of the server device 800 and the external storage device. The memory 802 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of a computer program. The memory 802 may also be used to temporarily store the data that has been output or will be output.
[0228] Figure 11 The structural schematic diagram of the terminal device provided by an embodiment of the present application. As Figure 11 shown, the terminal device 900 of this embodiment includes: at least one processor 901 ( Figure 11 only one is shown in the figure), a processor, a memory 902, and a computer program 903 stored in the memory 902 and executable on at least one processor 901. When the processor 901 executes the computer program 903, the steps in the above-mentioned embodiment of the card information processing method applied to the terminal device are implemented.
[0229] The terminal device 900 may be a smartphone, a smart watch, a smart speaker with a screen, a tablet computer, a customized terminal with a screen, etc. The terminal device may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art can understand that Figure 11 merely examples of the terminal device 900, which do not constitute a limitation on the terminal device 900, and may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0230] The so-called processor 901 may be a Central Processing Unit (CPU), and this processor 901 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0231] The memory 902 may be an internal storage unit of the terminal device 900 in some embodiments, such as the hard disk or memory of the terminal device 900. The memory 902 may also be an external storage device of the terminal device 900 in other embodiments, such as a plug-in hard disk equipped on the terminal device 900, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 902 may also include both the internal storage unit and the external storage device of the terminal device 900. The memory 902 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of a computer program. The memory 902 may also be used to temporarily store data that has been output or is to be output.
[0232] Embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements a method for processing card information applied to a server device.
[0233] Embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements a method for processing card information applied to a terminal device.
[0234] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the server device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0235] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0236] An embodiment of this application provides a chip system. The chip system includes a memory and a processor. The processor executes a computer program stored in the memory to implement a card information processing method applied to a server device.
[0237] An embodiment of this application provides a chip system. The chip system includes a memory and a processor. The processor executes a computer program stored in the memory to implement a card information processing method applied to a terminal device.
[0238] An embodiment of this application provides a chip system. The chip system includes a processor. The processor is coupled to a computer-readable storage medium. The processor executes a computer program stored in the computer-readable storage medium to implement a card information processing method applied to a server device.
[0239] An embodiment of this application provides a chip system. The chip system includes a processor. The processor is coupled to a computer-readable storage medium. The processor executes a computer program stored in the computer-readable storage medium to implement a card information processing method applied to a terminal device.
[0240] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0241] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in an electrical, mechanical or other form.
[0242] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0243] Finally, it should be noted that the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A card information processing method, applied to a server device, characterized in that including: Receiving a target card acquisition request from a terminal device, where the target card acquisition request includes the device context of the terminal device and the card content to be acquired, and the device context is used to describe device features; Generating replacement information for the target card according to the device context, the card content to be acquired, and a card code corresponding to the card content to be acquired; Obtaining card information corresponding to the device context, where the card information is generated according to a first code segment corresponding to the device context in the card code; Sending a display instruction to the terminal device, where the display instruction is used for the terminal device to generate the target card according to the replacement information and the card information.
2. The method according to claim 1, characterized in that The obtaining the card information corresponding to the device context includes: Determining, according to the device context of the terminal device, card information corresponding to the device context of the terminal device in a pre-stored card information set, where the card information set includes card information respectively corresponding to at least one device context, and the device context is one of the at least one device contexts.
3. The method according to claim 1 or 2, characterized in that, The device context includes device parameters, and a second code segment in the first code segment is replaced by a preset replacement identifier, and the second code segment is used to determine a card feature value corresponding to the device parameters.
4. The method according to claim 3, characterized in that, The display instruction includes a download address of the card information and the replacement information, and the download address is used to download the card information.
5. The method according to claim 3, characterized in that, The display instruction includes the card information and the replacement information.
6. A method for processing card information, applied to a terminal device, characterized in that, including: Sending a target card acquisition request to a server device, where the target card acquisition request includes the device context of the terminal device and the card content to be acquired, and the device context is used to describe device features; Receiving a display instruction from the server device; Obtaining replacement information and card information according to the display instruction, where the replacement information is the replacement information of the target card generated by the server device according to the device context, the card content to be acquired, and a card code corresponding to the card content to be acquired, and the card information is the card information generated by the server device according to a first code segment corresponding to the device context in the card code; Generating the target card according to the replacement information and the card information.
7. The method according to claim 6, characterized in that The generating the target card according to the replacement information and the card information includes: Replacing the replacement information into the card information to obtain replaced card information; Loading the replaced card information to generate the target card.
8. The method according to claim 6 or 7, characterized in that The display instruction includes a download address of the card information and the replacement information; The obtaining replacement information and card information according to the display instruction includes: Extracting the replacement information and the download address of the card information in the display instruction; Downloading the card information according to the download address of the card information.
9. The method according to claim 7, wherein The display instruction includes the card information and the replacement information; The obtaining replacement information and card information according to the display instruction includes: Extracting the replacement information and the card information in the display instruction.
10. The method according to claim 9, characterized in that, The card information includes a replacement identifier, and the replacement information includes a feature value of the replacement identifier; Replacing the replacement information into the card information to obtain the replaced card information includes: Replacing the replacement identifier in the card information with the feature value in the replacement information.
11. A card information processing device, which is applied to a server device, is characterized in that Includes: A receiving module, configured to receive a target card acquisition request from a terminal device, where the target card acquisition request includes the device context of the terminal device and the card content to be acquired, and the device context is used to describe device features; A generating module, configured to generate replacement information of a target card according to the device context, the card content to be acquired, and a card code corresponding to the card content to be acquired; An acquiring module, configured to acquire card information corresponding to the device context, where the card information is generated according to a first code segment corresponding to the device context in the card code; A sending module, configured to send a display instruction to the terminal device, where the display instruction is used for the terminal device to generate the target card according to the replacement information and the card information.
12. A card information processing device is applied to a terminal device, and is characterized in that, Includes: A sending module, configured to send an acquisition request for a target card to a server device, where the acquisition request for the target card includes the device context of the terminal device and the card content to be acquired, and the device context is used to describe device features; A receiving module, configured to receive a display instruction from the server device; An acquiring module, configured to acquire replacement information and card information according to the display instruction, where the replacement information is the replacement information of the target card generated by the server device according to the device context, the card content to be acquired, and a card code corresponding to the card content to be acquired, and the card information is the card information generated by the server device according to a first code segment corresponding to the device context in the card code; A generating module, configured to generate the target card according to the replacement information and the card information.
13. A server device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method described in any one of claims 1 to 5 is implemented.
14. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method described in any one of claims 6 to 10 is implemented.
15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the method described in any one of claims 1 to 5 is implemented.
16. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the method described in any one of claims 6 to 10 is implemented.
Citation Information
Patent Citations
Code generation method, storage medium, electronic equipment and code generation system
CN111273942A