CN113590346B - Method and electronic equipment for processing service request - Google Patents

Method and electronic equipment for processing service request Download PDF

Info

Publication number
CN113590346B
CN113590346B CN202110742364.7A CN202110742364A CN113590346B CN 113590346 B CN113590346 B CN 113590346B CN 202110742364 A CN202110742364 A CN 202110742364A CN 113590346 B CN113590346 B CN 113590346B
Authority
CN
China
Prior art keywords
processing
electronic device
service request
target object
remainder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110742364.7A
Other languages
Chinese (zh)
Other versions
CN113590346A (en
Inventor
宋新超
张文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Glory Smart Technology Development Co ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110742364.7A priority Critical patent/CN113590346B/en
Publication of CN113590346A publication Critical patent/CN113590346A/en
Application granted granted Critical
Publication of CN113590346B publication Critical patent/CN113590346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5013Request control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Abstract

The embodiment of the application provides a method for processing a service request and electronic equipment, wherein the method comprises the following steps: receiving a service request input by a user, and acquiring a first identifier, wherein the first identifier is used for uniquely determining the user; according to the first identification, determining a target value corresponding to the first identification; determining a target object for processing the service request according to the target value; and processing the service request by adopting the target object, wherein one first identifier corresponds to one target value, and one target value corresponds to one target object. The method can improve the consistency of the processing results of multiple service requests of the same user and also improve the experience consistency of the user.

Description

Method and electronic equipment for processing service request
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a method for processing a service request and an electronic device.
Background
In the services supported by current electronic devices, it is common to work with multiple vendors to ensure reliability. For example, translation services in the electronic device correspond to translation providers a and B, when a user wants to translate a segment of text, the user clicks a translation button, and the electronic device selects a provider according to a provider distribution rule, and the provider translates the segment of text.
Conventionally, when a service request (such as a translation request) of a user is allocated to a provider, the provider is usually allocated according to a preset provider share ratio. For example, the share ratio of suppliers a and B is 3: 7, namely, the ratio of the number of the service requests distributed to the A and the B is required to be ensured to be 3: 7; if there are 100 users initiating the translation request, the translation requests can be sequentially distributed, ensuring that 30 users 'translation requests are handled by provider a and 70 users' translation requests are handled by provider B.
However, for service requests of the same user for different times, if the provider allocation rule in the conventional technology is adopted, the service requests may be allocated to the provider a for processing for the first time and the provider B for processing for the second time, and due to different processing capabilities and styles of different providers, the processing results of the service requests of the same user for multiple times are inconsistent.
Disclosure of Invention
The application provides a method for processing service requests and electronic equipment, which can improve the consistency of processing results of multiple service requests of the same user and improve the experience consistency of the user.
In a first aspect, the present application provides a method for processing a service request, where the method is performed by an electronic device, and includes: receiving a service request input by a user, and acquiring a first identifier, wherein the first identifier is used for uniquely determining the user; according to the first identification, determining a target value corresponding to the first identification; determining a target object for processing the service request according to the target value; and processing the service request by adopting the target object, wherein one first identifier corresponds to one target value, and one target value corresponds to one target object.
The first identifier may be a user identifier, and the user identifier may be an identification number registered when the user registers, an International Mobile Subscriber Identity (IMSI) of the used electronic device, or a randomly generated serial number. The user identifiers of a large number of users are distributed unevenly, so that the electronic equipment calculates the user identifiers to obtain a target value distributed evenly in a certain interval. The target object is a provider which processes the service request of the user among a plurality of providers.
In the implementation manner, the electronic device firstly converts the user identifier initiating the service request to obtain the target value of uniform distribution, so that the preset share proportion among suppliers can be ensured. And then, the corresponding suppliers are determined according to the target values, and because one target value corresponds to one supplier, the user is distributed to the same supplier when initiating the service request every time, so that the consistency of the processing results of multiple service requests of the same user can be improved, and the experience consistency of the user is also improved.
With reference to the first aspect, in some implementations of the first aspect, the determining, according to the first identifier, a target value corresponding to the first identifier includes: and calculating the first identifier by adopting a Hash function to obtain a target value.
With reference to the first aspect and the foregoing implementation manner, due to the inherent uniformly distributed characteristic of the hash function, the obtained target value can be kept in a uniformly distributed state, so as to ensure that a preset share ratio between suppliers can be achieved.
With reference to the first aspect, in some implementations of the first aspect, the determining a target object for processing the service request according to the target value includes: performing remainder calculation on the target value and a preset parameter to determine a first remainder, wherein the parameter is the sum of the share numbers of a plurality of processing objects, the ratio of the share numbers of the plurality of processing objects is a preset ratio, and the plurality of processing objects comprise target objects; and determining the target object according to the first remainder.
The plurality of processing objects may be a plurality of suppliers, and the preset parameter may be a sum of share numbers of the suppliers, i.e., a total share number. Because the target value obtained by the hash function is usually long in bit number, the target value and the total share number can be subjected to remainder calculation, and the target object can be determined according to the remainder. Because the target value obtained by the user identification is unique, and further the first remainder obtained by the target value is also unique, the finally determined target object (namely the supplier) is also unique, so that the processing results of multiple service requests of the same user are consistent.
With reference to the first aspect, in some implementations of the first aspect, the determining a target object according to the first remainder includes: acquiring an incidence relation, wherein the incidence relation comprises a corresponding relation between a plurality of remainders and a plurality of processing objects, the plurality of remainders comprises a first remainder, and the number of the remainders corresponding to one processing object is equal to the number of shares of the processing object; and determining the target object according to the first remainder and the incidence relation.
The electronic device stores corresponding relations between a plurality of remainders and a plurality of suppliers, the number of the remainders corresponding to one supplier is equal to the share number of the supplier, and the electronic device can determine the corresponding supplier according to the value of the first remainder. Because the corresponding relation between the remainder and the provider is determined, the target object (namely the provider) determined by the first remainder is unique, so that the processing results of multiple service requests of the same user are kept consistent, the consistency of the processing results of the multiple service requests of the same user is improved, and the experience consistency of the user is also improved.
With reference to the first aspect, in some implementations of the first aspect, the method further includes: and when the number of the processing objects for processing the service request is increased or decreased, adjusting the share number of the plurality of processing objects.
With reference to the first aspect and the foregoing implementation manner, when the share number of the processing object changes, the user identifier is calculated to obtain a first remainder, and if the obtained first remainder is located in a remainder interval corresponding to the changed share number, when the part of users make a service request, a provider of a processing result of the service request changes, but the service request after that time keeps the provider unchanged, and providers allocated to service requests of other users always keep unchanged, so as to reduce the problem of inconsistent user experience to the greatest extent.
With reference to the first aspect, in some implementations of the first aspect, the method further includes: acquiring the actual ratio of the number of the service requests processed by a plurality of processing objects in a preset time period; if the actual share ratio corresponding to the first processing object is higher than the share ratio of the first processing object, reducing the share ratio of the first processing object according to a preset ratio; or if the actual share ratio corresponding to the first processing object is lower than the share ratio of the first processing object, increasing the share ratio of the first processing object according to a preset ratio, wherein the first processing object is one of the plurality of processing objects, and the share ratio of the first processing object is determined by the share ratio of the first processing object and the parameter.
With reference to the first aspect and the foregoing implementation manner, if the number of service requests actually processed by a certain provider does not reach an expected target, or exceeds an expected target, the electronic device may adjust the quota number of the provider accordingly, so as to keep the proportion of the quota number between the providers in an expected range.
In a second aspect, the present application provides an apparatus, which is included in an electronic device, and which has a function of implementing the behavior of the electronic device in the first aspect and the possible implementation manners of the first aspect. The functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described functions. Such as a receiving module or unit, a processing module or unit, etc.
In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory and the interface cooperate with each other to enable the electronic device to perform any one of the methods of the first aspect.
In a fourth aspect, the present application provides a chip comprising a processor. The processor is adapted to read and execute the computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof.
Optionally, the chip further comprises a memory, the memory being connected to the processor by a circuit or a wire.
Further optionally, the chip further comprises a communication interface.
In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is enabled to execute any one of the methods in the technical solutions of the first aspect.
In a sixth aspect, the present application provides a computer program product comprising: computer program code for causing an electronic device to perform any of the methods of the first aspect when the computer program code runs on the electronic device.
Drawings
Fig. 1 (a) is a schematic interface diagram of an example of initiating a translation service request according to an embodiment of the present application;
fig. 1 (b) is a schematic diagram of an exemplary operation interface for translating a service request according to an embodiment of the present application;
FIG. 1 (c) is a diagram showing an example of translation results provided in the embodiment of the present application;
fig. 2 is a schematic interface diagram of an example of a cloud identification service request provided in the embodiment of the present application;
fig. 3 is a schematic structural diagram of an example of an electronic device according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of a software architecture of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating an example of a method for processing a service request according to an embodiment of the present application;
fig. 6 is a flowchart illustrating another example of a method for processing a service request according to an embodiment of the present application;
FIG. 7 (a) is a schematic process flow diagram illustrating an example of a change in share number of a supplier according to an embodiment of the present application;
fig. 7 (b) is a schematic flowchart of another example of a method for processing a service request according to an embodiment of the present application;
fig. 8 is a schematic flowchart illustrating an example of adjusting the share number of the supplier according to the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein in the description of the embodiments of the present application, "/" indicates an inclusive meaning, for example, a/B may indicate a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
In the following, the terms "first", "second" and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
Currently, services supported by electronic devices often cooperate with multiple vendors. For example, in the translation scenario shown in fig. 1, when a user wants to translate a certain sentence, a long-press click operation may be performed on the interface shown in fig. 1 (a), at which a text selection box appears on the interface (as shown in fig. 1 (b)), and the user may drag the text selection box to the sentence to be translated; then, clicking a "translation" button above the text selection box (i.e. initiating a translation service request), the display interface of the electronic device may jump to the interface of (c) in fig. 1, and it can be seen that the translation result of the sentence to be translated may be displayed on the interface.
Generally, in a translation scenario, there are multiple suppliers, such as supplier a and supplier B, and these two suppliers have a preset share ratio, such as 3: 7, that is, it is necessary to ensure that the ratio of the number of translation service requests processed by the provider a and the provider B reaches 3: 7. in the conventional technology, when a user initiates a translation service request, an electronic device may send the request to a server, and the server sequentially allocates or randomly allocates corresponding providers according to a preset share ratio. However, under the rules of this distribution provider, it is possible for a user to have a first translation service request assigned to provider a processing and a second translation service request assigned to provider B processing; due to different processing capabilities and styles of different suppliers, the problem that translation results of multiple translation service requests of the same user are inconsistent exists, so that the experience of the user is inconsistent.
As another example of the cloud recognition scenario shown in fig. 2, when a user uploads a picture through an upload picture path of an electronic device, the user wants to recognize an object (e.g., a person) in the picture through a cloud recognition technology. Generally, a plurality of suppliers exist in a cloud identification scene, when a user initiates a cloud identification service request, the electronic device can send the request to the server, and the server sequentially allocates or randomly allocates the corresponding suppliers according to a preset share proportion. For a user, the first cloud identification service request may be allocated to the provider E for processing, and the second cloud identification service request may be allocated to the provider F for processing, so that the problem that the identification results of multiple cloud identification service requests of the same user are inconsistent may occur due to different processing capabilities of different providers.
In view of this, an embodiment of the present application provides a method for processing a service request, which may be applied to an electronic device with service support, such as a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, a super-mobile personal computer (UMPC), a netbook, and a Personal Digital Assistant (PDA). When a user initiates a service request through the electronic device, the user identification can be converted into the target value which is uniformly distributed, and then the suppliers are determined according to the target value, wherein one target value corresponds to one supplier, so that the effect of processing the service request of the same user by the same supplier can be achieved, the consistency of the processing result of multiple service requests of the same user is improved, and the experience consistency of the user is also improved. It should be noted that, the embodiment of the present application does not set any limit to a specific type of the electronic device.
For example, fig. 3 is a schematic structural diagram of an example of the electronic device 100 according to the embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. The structure of the antenna 1 and the antenna 2 in fig. 3 is only an example. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, among others. GNSS may include Global Positioning System (GPS), global navigation satellite system (GLONASS), beidou satellite navigation system (BDS), quasi-zenith satellite system (QZSS), and/or Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headset interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C to assist in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, the electronic device 100 may utilize the distance sensor 180F to range to achieve fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to save power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocking and locking the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human body pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signals acquired by the bone conduction sensor 180M, and the heart rate detection function is realized.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a hierarchical architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
Fig. 4 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom. The application layer may include a series of application packages.
As shown in fig. 4, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 4, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
For convenience of understanding, in the following embodiments of the present application, an electronic device with a structure shown in fig. 3 and fig. 4 is taken as an example, and with reference to the accompanying drawings and an application scenario, a method for processing a service request provided in the embodiments of the present application is specifically described.
Fig. 5 is a flowchart illustrating an example of a method for processing a service request according to an embodiment of the present application, where the method includes:
s101, receiving a service request input by a user, and acquiring a user identifier of the user.
The user may input a translation service request through the interface shown in fig. 1 (a), and the electronic device may obtain the user identifier of the user when receiving the service request. Optionally, the user identifier may be an identity card number registered when the user registers, an IMSI number of the used electronic device, or a randomly generated serial number, and the like.
Optionally, the service request may include a cloud recognition service request, a voice playing service request, and the like in addition to the translation service request, and the method for processing a service request according to the embodiment of the present application may be applied to any service request with multiple providers.
And S102, determining a target value corresponding to the user identifier according to the user identifier.
Because the user identifiers obtained by the electronic device are distributed unevenly, for example, the user identifiers of 100 users are disordered and have no regular distribution, the electronic device can perform mathematical calculation on the user identifiers to obtain corresponding target values, so that the target values of the 100 users are distributed evenly in a certain interval, that is, the electronic device converts the user identifier mapping into the evenly distributed target values.
As an implementation manner, the electronic device may perform normalization processing on the user identifier to obtain a corresponding target value. As another implementation manner, the electronic device may perform hash calculation on the user identifier to obtain a corresponding target value. It should be noted that, the method is applicable to a calculation method capable of converting the user identifier into a target value with uniform distribution, and the embodiment of the present application does not limit this.
Illustratively, after the electronic device performs mathematical calculation on the user identifiers of 100 users, 100 target values are obtained, and assuming that the mathematical calculation is used to map the user identifiers to the [0, 100) interval, about 10 target values among the 100 target values are in the [0, 10) interval, 10 target values are in the [10, 20) interval, 10 target values are in the [20, 30) interval, and so on, that the 100 target values are uniformly distributed in the [0, 100) interval.
S103, determining a target object for processing the service request according to the target value, and processing the service request by adopting the target object; one user identifier corresponds to one target value, and one target value corresponds to one target object.
Specifically, the target object is a provider that processes the service request, and the electronic device may determine the target object that processes the service request according to a correspondence between the target value and the target object, and process the service request using the target object. It should be noted that, after the above mathematical calculation, one user identifier may correspond to one target value, and the target value also corresponds to only one target object, so that for a service request of one user, as long as the user identifier does not change, the target object allocated to the user identifier by the electronic device does not change.
Alternatively, since the target values of a plurality of users are uniformly distributed in a certain interval, the interval may be divided into a plurality of sub-intervals, each sub-interval corresponds to a supplier, the target value distributed in the first sub-interval corresponds to the supplier a, the target value distributed in the second sub-interval corresponds to the supplier B, and so on. For example, if the above-mentioned 100 target values are uniformly distributed in the [0, 100) interval, the interval can be divided into two sub-intervals of [0, 30) and [30, 100), where the [0, 30) sub-interval corresponds to the supplier a and the [30, 100) sub-interval corresponds to the supplier B; if the target value obtained by the mathematical calculation of the existing user identifier is 25, the user identifier can be determined to be within [0, 30), and the electronic equipment allocates the service request to the provider A to process the service request; and then, if the user initiates the service request again, the process is still executed, and the provider A is adopted to process the service request, so that the consistency of the processing results of multiple service requests of the same user can be improved, and the experience consistency of the user is also improved.
It can be understood that, since the target values of the plurality of users are uniformly distributed, in the case that the number of users is large enough, the number of target values distributed in the two sub-intervals of [0, 30) and [30, 100) described above tends to be 3: 7, namely the ratio of the number of service requests processed by the provider A and the provider B reaches 3: and 7, the embodiment of the application can simultaneously ensure that the preset share proportion among suppliers is achieved.
In the method for processing the service request, the electronic equipment firstly converts the user identification initiating the service request to obtain the target value which is uniformly distributed, and the preset share proportion among suppliers can be ensured. And then, the corresponding suppliers are determined according to the target values, and because one target value corresponds to one supplier, the user is distributed to the same supplier when initiating the service request every time, so that the consistency of the processing results of multiple service requests of the same user can be improved, and the experience consistency of the user is also improved.
In one embodiment, for the step of S102, the electronic device may be implemented as follows: and calculating the user identification by adopting a Hash function to obtain a target value. Alternatively, the hash function may be secure hash algorithm 2 (SHA-2), including but not limited to SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256, and the like.
Taking SHA-256 as an example, for a message of any length, SHA-256 will generate a 256-bit hash value, called a message digest; this digest corresponds to an array of 32 bytes in length, usually represented by a 64-byte hexadecimal string, where 1 byte is 8 bits and a hexadecimal character is 4 bits in length. Therefore, after the electronic device calculates the user identifier by using SHA-256, a 256-bit hash value, i.e., a target value, can be obtained.
Since the length of the obtained target value is 256 bits, in order to facilitate the interval judgment of the target value to determine the target object, the electronic device may first define the share number of each processing object (i.e. supplier), and the ratio between the share numbers of the suppliers is a preset ratio. For example, assuming that there are three providers A, B and C, according to the agreement with the providers, it is necessary to make the ratio of the number of service requests handled by the providers A, B and C1: 1: 3, namely the preset ratio is 1: 1: 3, the share numbers of the suppliers A, B and C can be defined as 20, 20 and 60 respectively, and the total share number is (20+20+60) ═ 100. Illustratively, the supplier share number may be defined by:
“conditions”:{“packageName”:[“xxx”],“type”:[“text”]},
“vendor”:[
{“A”:“20”},
{“B:“20”},
{“C":“60"}
]}
then, the step of determining a target object for processing the service request according to the target value may be implemented in the following manner: and performing remainder calculation on the target value and the total share number, determining a first remainder, and determining a target object according to the first remainder. Specifically, the electronic device performs remainder calculation by using the target value as a dividend and the total share number (i.e., 100) as a divisor, so as to obtain a remainder between [0, 100 ], and then determines the target object according to an interval in which the remainder is located. In one implementation, the electronic device can divide the remainder interval [0, 100) into three sub-intervals according to the above ratio: [0, 20), [20, 40) and [40, 100), and then determining a target object according to the value of the remainder and the sub-interval, wherein the target object is assigned with a provider A when the first remainder is in the [0, 20) interval, a provider B when the first remainder is in the [20, 40) interval, and a provider C when the first remainder is in the [40, 100) interval.
In another implementation, the electronic device can determine the target object based on the share number and remainder value of the supplier. The electronic device stores corresponding relations between a plurality of remainders and a plurality of suppliers, the number of the remainders corresponding to one supplier is equal to the share number of the supplier, and the electronic device can determine the corresponding supplier according to the value of the first remainder. Illustratively, supplier a has a share number of 20, and its corresponding remainder is assumed to be 20 remainders between [0, 20), supplier B has a share number of 20, its corresponding remainder is assumed to be 20 remainders between [20, 40), supplier C has a share number of 60, and its corresponding remainder is assumed to be 60 remainders between [40, 100), and is assigned supplier a when the first remainder is in the interval of [0, 20), supplier B when the first remainder is in the interval of [20, 40), and is assigned supplier C when the first remainder is in the interval of [40, 100); alternatively, assume that provider a corresponds to 20 remainders between [80, 100), provider B corresponds to 20 remainders between [60, 80), and provider C corresponds to 60 remainders between [0, 60). It should be noted that each provider corresponds to which remainder interval, which is not limited in the embodiments of the present application, but once the remainder intervals of the providers are set, the remainder intervals are not changed, so that when the same user initiates a service request multiple times, a target value obtained by a user identifier of the user is unique, and further, a first remainder obtained by the target value is also unique, and a finally determined target object (i.e., the provider) is also unique, that is, a processing result of multiple service requests of the same user is consistent.
It should be further noted that, in the embodiments of the present application, the quota of the supplier is not limited, as long as the preset ratio is satisfied; however, when the ratio actually required to be set changes, the share number of the provider also changes correspondingly, and at this time, the processing result of the service request of the user may change once, but when the service request is subsequently performed, the processing result is still consistent with the changed processing result, so as to reduce the problem of inconsistent user experience to the greatest extent.
To better understand the above process of determining the target object, an embodiment thereof will be described below. Taking the service request as an example of translating the service request, referring to fig. 6, a user initiates the translation service request through the interface (a) in fig. 1, and after receiving the translation service request, the electronic device obtains the user identifier of the user. And then, calculating the user identification by adopting a hash function to obtain a target value. And then the target value is used as a dividend, and the set total share number is used as a divisor to carry out remainder calculation to obtain a first remainder. The remainder interval is determined to be the first remainder, and a provider A is allocated if the first remainder is in the interval [0, 20), a provider B is allocated if the first remainder is in the interval [20, 40), and a provider C is allocated if the first remainder is in the interval [40, 100).
In one scenario, the share number of the supplier (i.e. the processing object) varies, but the total share number does not vary, for example, the original share numbers of the suppliers A, B and C are 20, 60, and the original share numbers of the suppliers are now 20, 30, 50, i.e. the configuration of the share number of the supplier is modified as follows:
“conditions”:{“packageName”:[“xxx”],“type”:[“text”]},
“vendor”:[
{“A”:“20”},
{“B:“30”},
{“C":“50"}
]}
if the original first remainder is in the interval [0, 20), then the supplier a is allocated, if the first remainder is in the interval [20, 40), then the supplier B is allocated, if the first remainder is in the interval [40, 100), then the supplier C is allocated, then it is necessary to change the interval where the first remainder is in the interval [0, 20) then the supplier a is allocated, if the first remainder is in the interval [20, 50) then the supplier B is allocated, if the first remainder is in the interval [50, 100), then the supplier C is allocated. By comparison, the supplier corresponding to the interval of the first remainder being [40, 50) is changed from C to B, while the rest remainders are not affected; that is, when the user identification is calculated to obtain the first remainder, and the part of the users with the obtained first remainder at [40, 50) are making service requests, the provider of the processing result of the service request at one time is changed from C to B, but the service requests after this time are kept processed by the provider B, and the providers assigned to the service requests of other users are kept unchanged.
In another scenario, the remainder interval may need to be readjusted if the share number of the supplier (i.e., the processing target) changes and the total share number also changes. For example, the original share number of the supplier A, B and C is 20, 20 and 60, the original share number is changed into 200, 200 and 600, and the total share number is changed from 100 to 1000; when the electronic device performs the remainder calculation using the target value as the dividend and the total share number (i.e. 1000) as the divisor, a remainder between [0, 1000) can be obtained, and then it can be assumed that the remainder corresponding to the supplier a is 200 remainders between [0, 200), the remainder corresponding to the supplier B is 200 remainders between [200, 400), and the remainder corresponding to the supplier C is 600 remainders between [400, 1000), and the supplier a is assigned when the first remainder is located in the interval of [0, 200), the supplier B is assigned when the first remainder is located in the interval of [200, 400), and the supplier C is assigned when the first remainder is located in the interval of [400, 1000). In this scenario, when most users make service requests, the provider of the processing result of one service request changes, but the service request remains unchanged after this time.
In yet another scenario, the number of suppliers (i.e., process targets) increases or decreases, and the share number of other suppliers needs to be adjusted. For example, if suppliers A, B and C have original share numbers of 20, 60, and supplier a is no longer needed, then the ratio of the original share numbers of suppliers B and C may be 1: and 3, adjusting share numbers of suppliers B and C to be 25 and 75, wherein the suppliers corresponding to the interval with the original first remainder of [0, 5) are changed from A to B, the suppliers corresponding to the interval with the original first remainder of [5, 20) are changed from A to C, and the suppliers corresponding to the rest remainders are kept unchanged. For another example, the original share numbers of the suppliers A, B and C are 20, 20 and 60, and the supplier D is required to be added, according to the preset share number ratio 1 of the suppliers A, B, C and D: 1: 2: 1, the share numbers of the suppliers A, B, C and D are adjusted to 20, 40 and 20, the supplier corresponding to the original first remainder in the interval [80, 100) is changed from C to D, and the suppliers corresponding to the rest remainders are kept unchanged. That is, when the user identifier is calculated to obtain the first remainder, the provider of the processing result of the service request changes when the service request is made by the user of the portion of the obtained first remainder located in the interval [0, 20) or [80, 100), but the service request after this time keeps the provider unchanged, and the provider assigned to the service request of other users keeps unchanged all the time.
For example, the above process flow of the share number of the provider is shown in (a) of fig. 7, and after the share number of the provider is changed, the process flow of the electronic device determining the corresponding provider for the service request of the user is shown in (b) of fig. 7.
In yet another scenario, suppliers A, B and C have share numbers of 20, 60, with a ratio of share numbers of 1: 1: 3, i.e. the ratio of the number of service requests that should be handled by the providers A, B and C is also 1: 1: 3, when the user actually uses the electronic device, a part of the users may not initiate service requests within a period of time, which results in that the number of service requests processed by the corresponding provider does not reach an expected target, or a part of the users initiate service requests within a period of time too many times, which results in that the number of service requests processed by the corresponding provider exceeds a standard. For this problem, in this embodiment of the application, the electronic device may further obtain an actual percentage of the number of service requests processed by each provider in a preset time period, and if the actual percentage of the number of service requests corresponding to a certain provider is higher than the percentage of the number of shares, reduce the number of shares of the provider according to a preset ratio; or if the actual ratio of the service request quantity corresponding to a certain supplier is lower than the share ratio, increasing the share ratio of the supplier according to a preset ratio.
Illustratively, since the ratio of the share numbers of suppliers A, B and C is 1: 1: 3, the share amount of the supplier A accounts for 20%, the share amount of the supplier B accounts for 20%, and the share amount of the supplier C accounts for 60%. If the actual share ratio of the service request amount processed by the provider a, which is obtained by the electronic device, is 25% higher than the share ratio thereof, the share ratio of the provider a may be decreased by a preset ratio (e.g., 1%) and the share ratios of the providers B and C may be increased. If the actual share ratio of the service request quantity processed by the supplier a, which is acquired by the electronic device, is 15% and is lower than the share ratio, the share ratio of the supplier a can be increased by 1%, and the share ratios of the suppliers B and C can be reduced.
Optionally, after the actual percentage of the service request quantity corresponding to a certain provider is higher than a certain proportion (e.g., 2%) of the quota percentage, the electronic device may decrease the quota of the provider according to a preset proportion; or, if the actual percentage of the service request quantity corresponding to a certain provider is lower than a certain proportion (e.g. 2%) of the share percentage, increasing the share percentage of the provider according to a preset proportion. For example, the above procedure for adjusting the quota of the provider according to the actual service request amount of the provider can be seen in fig. 8.
In the above embodiment, the electronic device may correspondingly adjust the share number of each provider and the remainder interval corresponding to each provider according to the number change of the providers, the share number change, and the like, so as to reduce the problem of inconsistent user experience to the greatest extent.
The foregoing details an example of the method for processing a service request provided in the embodiment of the present application. It will be appreciated that the electronic device, in order to implement the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, with the embodiment described in connection with the particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional modules according to the method example, for example, the functional modules may be divided into the functional modules corresponding to the functions, such as the detection unit, the processing unit, the display unit, and the like, or two or more functions may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
It should be noted that all relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
The electronic device provided by this embodiment is configured to execute the method for processing the service request, so that the same effect as that of the implementation method can be achieved.
In case of an integrated unit, the electronic device may further comprise a processing module, a storage module and a communication module. The processing module can be used for controlling and managing the action of the electronic equipment. The memory module may be used to support the electronic device in executing stored program codes and data, etc. The communication module can be used for supporting the communication between the electronic equipment and other equipment.
The processing module may be a processor or a controller. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., a combination comprising one or more microprocessors, Digital Signal Processing (DSP) and microprocessors, or the like. The storage module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In an embodiment, when the processing module is a processor and the storage module is a memory, the electronic device according to this embodiment may be a device having the structure shown in fig. 3.
An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is enabled to execute the method for processing a service request according to any of the above embodiments.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute the above related steps to implement the method for processing a service request in the above embodiment.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute the method for processing the service request in the above-mentioned method embodiments.
The electronic device, the computer-readable storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer-readable storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the description of the above embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the above functional modules is used as an example, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented as a software functional unit and sold or used as a separate product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (7)

1. A method of processing a service request, the method being performed by an electronic device and comprising:
receiving a first service request input by a user, and acquiring a first identifier, wherein the first identifier is used for uniquely determining the user;
determining a first target value corresponding to the first identifier according to the first identifier;
performing remainder calculation on the first target value and a preset parameter, determining a first remainder, and determining a first target object according to a first share number corresponding to the first remainder; wherein the parameter is the sum of the volume numbers of a plurality of processing objects, the ratio between the volume numbers of the plurality of processing objects is a preset ratio, the plurality of processing objects comprises the first target object and a second target object, and the volume numbers of the plurality of processing objects comprises the first volume number of the first target object and a second volume number of the second target object;
processing the first service request by adopting the first target object;
acquiring the actual ratio of the number of the service requests processed by the plurality of processing objects in a preset time period;
if the service request quantity of the first target object exceeds the first quota, adjusting the first quota and the second quota to enable the reduced quantity in the adjusted first quota to be equal to the increased quantity in the adjusted second quota;
receiving a second service request input by the user, and acquiring a second identifier;
determining a second target value corresponding to the second identifier according to the second identifier;
performing remainder calculation on the second target value, determining a second remainder, and determining the second target object according to the adjusted second share corresponding to the second remainder;
and processing the second service request by adopting the second target object.
2. The method of claim 1, wherein determining, based on the first identifier, a first target value corresponding to the first identifier comprises:
and calculating the first identifier by adopting a Hash function to obtain the first target value.
3. The method of claim 1, wherein determining a first target object based on a first share number corresponding to the first remainder comprises:
acquiring an association relation, wherein the association relation comprises a corresponding relation between a plurality of remainders and a plurality of processing objects, the plurality of remainders comprise the first remainders, and the number of the remainders corresponding to one processing object is equal to the share number of the processing object;
and determining the first target object according to the first remainder and the incidence relation.
4. An electronic device, comprising:
one or more processors;
one or more memories;
a module installed with a plurality of applications;
the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the steps of:
receiving a first service request input by a user, and acquiring a first identifier, wherein the first identifier is used for uniquely determining the user;
determining a first target value corresponding to the first identifier according to the first identifier;
performing remainder calculation on the first target value and a preset parameter, determining a first remainder, and determining a first target object according to a first share number corresponding to the first remainder; wherein the parameter is the sum of the volume numbers of a plurality of processing objects, the ratio between the volume numbers of the plurality of processing objects is a preset ratio, the plurality of processing objects comprises the first target object and a second target object, and the volume numbers of the plurality of processing objects comprises the first volume number of the first target object and a second volume number of the second target object;
processing the first service request by adopting the first target object;
acquiring the actual ratio of the number of the service requests processed by the plurality of processing objects in a preset time period;
if the service request quantity of the first target object exceeds the first quota, adjusting the first quota and the second quota to enable the reduced quantity in the adjusted first quota to be equal to the increased quantity in the adjusted second quota;
receiving a second service request input by the user, and acquiring a second identifier;
determining a second target value corresponding to the second identifier according to the second identifier;
performing remainder calculation on the second target value, determining a second remainder, and determining the second target object according to the adjusted second share corresponding to the second remainder;
and processing the second service request by adopting the second target object.
5. The electronic device of claim 4, wherein the one or more programs, when executed by the processor, cause the electronic device to perform the steps of:
and calculating the first identifier by adopting a Hash function to obtain the target value.
6. The electronic device of claim 4, wherein the one or more programs, when executed by the processor, cause the electronic device to perform the steps of:
acquiring an association relation, wherein the association relation comprises a corresponding relation between a plurality of remainders and a plurality of processing objects, the plurality of remainders comprise the first remainders, and the number of the remainders corresponding to one processing object is equal to the share number of the processing object;
and determining the first target object according to the first remainder and the incidence relation.
7. A computer-readable storage medium, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the method of any one of claims 1 to 3.
CN202110742364.7A 2021-06-30 2021-06-30 Method and electronic equipment for processing service request Active CN113590346B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110742364.7A CN113590346B (en) 2021-06-30 2021-06-30 Method and electronic equipment for processing service request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110742364.7A CN113590346B (en) 2021-06-30 2021-06-30 Method and electronic equipment for processing service request

Publications (2)

Publication Number Publication Date
CN113590346A CN113590346A (en) 2021-11-02
CN113590346B true CN113590346B (en) 2022-06-21

Family

ID=78245648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110742364.7A Active CN113590346B (en) 2021-06-30 2021-06-30 Method and electronic equipment for processing service request

Country Status (1)

Country Link
CN (1) CN113590346B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115471168B (en) * 2021-12-14 2023-07-18 国网上海市电力公司 Automated process processing method, apparatus, electronic device and computer readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955984A (en) * 2014-03-24 2014-07-30 广州华多网络科技有限公司 Method, server, voting processing node and system for achieving interconnection network voting
CN105491149A (en) * 2015-12-26 2016-04-13 深圳市金立通信设备有限公司 Data storage method and terminal
CN110830234A (en) * 2019-11-06 2020-02-21 腾讯科技(深圳)有限公司 User traffic distribution method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148850B (en) * 2010-08-09 2014-08-06 华为软件技术有限公司 Cluster system and service processing method thereof
CN103024056B (en) * 2012-12-17 2016-01-20 山东中创软件商用中间件股份有限公司 Data processing method, load equalizer and cloud system
CN104426834B (en) * 2013-08-19 2019-06-28 腾讯科技(深圳)有限公司 A kind of web-page requests method, client, server and system
US10789623B1 (en) * 2016-09-23 2020-09-29 Zeta Global Corp. Ad collision reduction
CN111884949B (en) * 2020-08-05 2022-05-17 支付宝(杭州)信息技术有限公司 Method, device and system for determining and realizing shunting scheme of AB experiment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955984A (en) * 2014-03-24 2014-07-30 广州华多网络科技有限公司 Method, server, voting processing node and system for achieving interconnection network voting
CN105491149A (en) * 2015-12-26 2016-04-13 深圳市金立通信设备有限公司 Data storage method and terminal
CN110830234A (en) * 2019-11-06 2020-02-21 腾讯科技(深圳)有限公司 User traffic distribution method and device

Also Published As

Publication number Publication date
CN113590346A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN109814766B (en) Application display method and electronic equipment
CN113704014B (en) Log acquisition system, method, electronic device and storage medium
CN111666119A (en) UI component display method and electronic equipment
CN113722058B (en) Resource calling method and electronic equipment
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN113961157B (en) Display interaction system, display method and equipment
WO2021159746A1 (en) File sharing method and system, and related device
CN114461588B (en) Method for adjusting pre-reading window and electronic equipment
CN110636554B (en) Data transmission method and device
CN113821767A (en) Application program authority management method and device and electronic equipment
CN114817939A (en) Authority control method and electronic equipment
CN113536374A (en) Image privacy protection method and electronic equipment
CN114741720A (en) Authority management method and terminal equipment
CN113986369B (en) Internet of things equipment control method and system, electronic equipment and storage medium
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
CN115333941A (en) Method for acquiring application running condition and related equipment
CN113590346B (en) Method and electronic equipment for processing service request
CN114006712A (en) Method, electronic equipment and system for acquiring verification code
CN114995715B (en) Control method of floating ball and related device
CN114006698B (en) token refreshing method and device, electronic equipment and readable storage medium
CN115017498B (en) Method for operating applet and electronic device
WO2022033355A1 (en) Mail processing method and electronic device
CN116828100A (en) Bluetooth audio playing method, electronic equipment and storage medium
CN115706916A (en) Wi-Fi connection method and device based on position information
CN114546969A (en) File sharing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230909

Address after: 201306 building C, No. 888, Huanhu West 2nd Road, Lingang New Area, Pudong New Area, Shanghai

Patentee after: Shanghai Glory Smart Technology Development Co.,Ltd.

Address before: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee before: Honor Device Co.,Ltd.